mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
Kotlin: Add test case for ::class type check in equals
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| Test.kt:10:14:12:5 | equals | This 'equals()' method does not check argument type. |
|
||||
|
||||
@@ -5,3 +5,9 @@ data class E(val x: Int) {
|
||||
return (other as? E)?.x == this.x
|
||||
}
|
||||
}
|
||||
|
||||
data class F(val x: Int) {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other != null && other::class == this::class
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user