mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Add override tests
This commit is contained in:
@@ -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 |
|
||||
@@ -0,0 +1 @@
|
||||
Advisory/Declarations/MissingOverrideAnnotation.ql
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user