[KMP] Implement ACTUAL_TYPE_ALIAS_TO_NOTHING/TO_NULLABLE_TYPE errors

^KT-60650 Done
This commit is contained in:
marat.akhin
2023-07-25 12:22:28 +02:00
committed by Space Team
parent 7cef7ac639
commit 34b271b13d
23 changed files with 249 additions and 1 deletions
@@ -0,0 +1,2 @@
expect class E01
expect class E02
@@ -0,0 +1,4 @@
typealias MyNothing = Nothing
actual typealias E01 = Nothing
actual typealias E02 = MyNothing
@@ -0,0 +1,13 @@
-- Common --
Exit code: OK
Output:
-- JVM --
Exit code: COMPILATION_ERROR
Output:
compiler/testData/multiplatform/implTypeAlias/actualTypealiasToNothing/jvm.kt:3:1: error: right-hand side of actual type alias cannot be of type kotlin.Nothing
actual typealias E01 = Nothing
^
compiler/testData/multiplatform/implTypeAlias/actualTypealiasToNothing/jvm.kt:4:1: error: right-hand side of actual type alias should be a class, not another type alias
actual typealias E02 = MyNothing
^
@@ -0,0 +1,2 @@
expect class E01
expect class E02
@@ -0,0 +1,4 @@
typealias MyNullable = String?
actual typealias E01 = String?
actual typealias E02 = MyNullable
@@ -0,0 +1,13 @@
-- Common --
Exit code: OK
Output:
-- JVM --
Exit code: COMPILATION_ERROR
Output:
compiler/testData/multiplatform/implTypeAlias/actualTypealiasToNullableType/jvm.kt:3:1: error: right-hand side of actual type alias cannot be a nullable type
actual typealias E01 = String?
^
compiler/testData/multiplatform/implTypeAlias/actualTypealiasToNullableType/jvm.kt:4:1: error: right-hand side of actual type alias should be a class, not another type alias
actual typealias E02 = MyNullable
^