mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Kotlin: Add a test for type aliases
This commit is contained in:
16
java/ql/test/kotlin/library-tests/type_aliases/test.kt
Normal file
16
java/ql/test/kotlin/library-tests/type_aliases/test.kt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
class MyClass<T> {}
|
||||||
|
|
||||||
|
typealias AliasInt = Int
|
||||||
|
typealias AliasX = MyClass<Int>
|
||||||
|
typealias AliasY = MyClass<AliasInt>
|
||||||
|
|
||||||
|
fun someFun(
|
||||||
|
x1: Int,
|
||||||
|
x2: AliasInt,
|
||||||
|
x3: MyClass<Int>,
|
||||||
|
x4: AliasX,
|
||||||
|
x5: MyClass<AliasInt>,
|
||||||
|
x6: AliasY) {
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
| test.kt:4:1:4:24 | AliasInt | file://:0:0:0:0 | Kotlin not-null Int |
|
||||||
|
| test.kt:5:1:5:31 | AliasX | file://:0:0:0:0 | Kotlin not-null MyClass |
|
||||||
|
| test.kt:6:1:6:36 | AliasY | file://:0:0:0:0 | Kotlin not-null MyClass |
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import java
|
||||||
|
|
||||||
|
from KotlinTypeAlias ta
|
||||||
|
select ta, ta.getKotlinType()
|
||||||
Reference in New Issue
Block a user