Add override tests

This commit is contained in:
Tamas Vajk
2022-04-07 09:29:21 +02:00
committed by Ian Lynagh
parent ca99cb4999
commit 92de139805
3 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
| Test.kt:16:14:18:5 | m | This method overrides $@; it is advisable to add an Override annotation. | Test.kt:2:10:4:5 | m | A.m |
| Test.kt:22:14:22:24 | o | This method overrides $@; it is advisable to add an Override annotation. | Test.kt:12:5:12:11 | o | I.o |
| Test.kt:24:14:24:22 | getP | This method overrides $@; it is advisable to add an Override annotation. | Test.kt:8:10:8:18 | getP | A.getP |

View File

@@ -0,0 +1 @@
Advisory/Declarations/MissingOverrideAnnotation.ql

View File

@@ -0,0 +1,25 @@
open class A {
open fun m(): Int {
return 23
}
private fun n() {}
open val p = 5
}
interface I {
fun o()
}
class B : A(), I {
override fun m(): Int {
return 42
}
fun n() {}
override fun o() { }
override val p = 7
}