Kotlin: Add abstract to concrete type cast guarded by when

This commit is contained in:
Tamas Vajk
2022-10-25 10:16:37 +02:00
parent b9f1cc5c6f
commit 690d6517d7
3 changed files with 7 additions and 0 deletions

View File

@@ -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> |

View File

@@ -0,0 +1 @@
Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql

View File

@@ -0,0 +1,5 @@
fun fn(m: MutableList<Int>) {
if (m is ArrayList) {
m.ensureCapacity(5)
}
}