[FE] Prohibit default arguments in expect declarations actualized via typealias
Cases when default argument inhertied from super class are allowed. Some tests for default arguments already exist and can be found in `testData/diagnostics/tests/multiplatform/defaultArguments`, for example `annotationsViaActualTypeAlias.kt`. ^KT-57614 Fixed Merge-request: KT-MR-10356 Merged-by: Roman Efremov <Roman.Efremov@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
9829a2bf98
commit
d2eb4a0abf
-18
@@ -1,18 +0,0 @@
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// IGNORE_BACKEND_K2: JVM_IR, JS_IR, NATIVE
|
||||
// FIR status: In FIR, declaring the same `expect` and `actual` classes in one compiler module is not possible (see KT-55177).
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: impl.kt
|
||||
class A(val result: String = "OK")
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: multiplatform.kt
|
||||
expect class B(result: String = "FAIL")
|
||||
|
||||
actual typealias B = A
|
||||
|
||||
fun box(): String {
|
||||
return B().result
|
||||
}
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// IGNORE_BACKEND_K1: ANY
|
||||
// IGNORE_BACKEND_MULTI_MODULE: ANY
|
||||
|
||||
// MODULE: lib1
|
||||
// FILE: impl.kt
|
||||
class A(val result: String = "OK")
|
||||
|
||||
// MODULE: lib2
|
||||
// FILE: B.kt
|
||||
expect class B(result: String = "FAIL")
|
||||
|
||||
// MODULE: main(lib1)()(lib2)
|
||||
// FILE: multiplatform.kt
|
||||
actual typealias B = A
|
||||
|
||||
fun box(): String {
|
||||
return B().result
|
||||
}
|
||||
Reference in New Issue
Block a user