Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb1124b

Browse files
committed
Kotlin: Add a test for type aliases
1 parent 87b4331 commit cb1124b

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
class MyClass<T> {}
3+
4+
typealias AliasInt = Int
5+
typealias AliasX = MyClass<Int>
6+
typealias AliasY = MyClass<AliasInt>
7+
8+
fun someFun(
9+
x1: Int,
10+
x2: AliasInt,
11+
x3: MyClass<Int>,
12+
x4: AliasX,
13+
x5: MyClass<AliasInt>,
14+
x6: AliasY) {
15+
}
16+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| test.kt:4:1:4:24 | AliasInt | file://:0:0:0:0 | Kotlin not-null Int |
2+
| test.kt:5:1:5:31 | AliasX | file://:0:0:0:0 | Kotlin not-null MyClass |
3+
| test.kt:6:1:6:36 | AliasY | file://:0:0:0:0 | Kotlin not-null MyClass |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import java
2+
3+
from KotlinTypeAlias ta
4+
select ta, ta.getKotlinType()

0 commit comments

Comments
 (0)