Skip to content

Commit 690d651

Browse files
committed
Kotlin: Add abstract to concrete type cast guarded by when
1 parent b9f1cc5 commit 690d651

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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> |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fun fn(m: MutableList<Int>) {
2+
if (m is ArrayList) {
3+
m.ensureCapacity(5)
4+
}
5+
}

0 commit comments

Comments
 (0)