mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Kotlin: Add a test for nested types
This commit is contained in:
16
java/ql/test-kotlin2/library-tests/nested_types/test.kt
Normal file
16
java/ql/test-kotlin2/library-tests/nested_types/test.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
import java.util.Stack;
|
||||
|
||||
// Diagnostic Matches: %Making use of Stack a raw type to avoid infinite recursion%
|
||||
|
||||
class MyType
|
||||
|
||||
fun foo1(x: List<List<List<List<MyType>>>>) { }
|
||||
|
||||
fun foo2(x: Stack<Stack<Stack<Stack<MyType>>>>) { }
|
||||
|
||||
class MkT<T> { }
|
||||
|
||||
fun foo3(x: MkT<MkT<MkT<MkT<MyType>>>>) { }
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
| file:///!unknown-binary-location/MkT.class:0:0:0:0 | MkT<MkT<MkT<MkT<MyType>>>> |
|
||||
| file:///!unknown-binary-location/MkT.class:0:0:0:0 | MkT<MkT<MkT<MyType>>> |
|
||||
| file:///!unknown-binary-location/MkT.class:0:0:0:0 | MkT<MkT<MyType>> |
|
||||
| file:///!unknown-binary-location/MkT.class:0:0:0:0 | MkT<MyType> |
|
||||
| file:///modules/java.base/java/util/List.class:0:0:0:0 | List<? extends List<? extends List<? extends List<MyType>>>> |
|
||||
| file:///modules/java.base/java/util/List.class:0:0:0:0 | List<? extends List<? extends List<MyType>>> |
|
||||
| file:///modules/java.base/java/util/List.class:0:0:0:0 | List<? extends List<MyType>> |
|
||||
| file:///modules/java.base/java/util/List.class:0:0:0:0 | List<MyType> |
|
||||
| file:///modules/java.base/java/util/List.class:0:0:0:0 | List<Stack<MyType>> |
|
||||
| file:///modules/java.base/java/util/Stack.class:0:0:0:0 | Stack<MyType> |
|
||||
| file:///modules/java.base/java/util/Stack.class:0:0:0:0 | Stack<Stack<MyType>> |
|
||||
| file:///modules/java.base/java/util/Stack.class:0:0:0:0 | Stack<Stack<Stack<MyType>>> |
|
||||
| file:///modules/java.base/java/util/Stack.class:0:0:0:0 | Stack<Stack<Stack<Stack<MyType>>>> |
|
||||
7
java/ql/test-kotlin2/library-tests/nested_types/types.ql
Normal file
7
java/ql/test-kotlin2/library-tests/nested_types/types.ql
Normal file
@@ -0,0 +1,7 @@
|
||||
import java
|
||||
|
||||
from Type t
|
||||
where
|
||||
t.getName().matches("%MyType%") and
|
||||
t.getName().matches(["List<%", "Stack<%", "MkT<%"])
|
||||
select t
|
||||
Reference in New Issue
Block a user