Kotlin: Add a test for type aliases

This commit is contained in:
Ian Lynagh
2021-11-04 12:50:05 +00:00
parent 87b433142c
commit cb1124b5ff
3 changed files with 23 additions and 0 deletions

View 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) {
}

View File

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

View File

@@ -0,0 +1,4 @@
import java
from KotlinTypeAlias ta
select ta, ta.getKotlinType()