mirror of
https://github.com/github/codeql.git
synced 2025-12-22 19:56:32 +01:00
Kotlin: Add abstract to concrete type cast guarded by when
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| Test.kt:3:9:3:9 | <implicit cast> | $@ is cast to the concrete type $@, losing abstraction. | file:///modules/java.base/java/util/List.class:0:0:0:0 | List | List<Integer> | file:///modules/java.base/java/util/ArrayList.class:0:0:0:0 | ArrayList | ArrayList<Integer> |
|
||||
@@ -0,0 +1 @@
|
||||
Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql
|
||||
@@ -0,0 +1,5 @@
|
||||
fun fn(m: MutableList<Int>) {
|
||||
if (m is ArrayList) {
|
||||
m.ensureCapacity(5)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user