[K2, MPP] Support actualization of enums and annotations that have primary constructor with arguments
^KT-57241 Fixed
This commit is contained in:
committed by
Space Team
parent
44807b7bd4
commit
60edf1def3
+1
-1
@@ -171,7 +171,7 @@ private class MemberLinksCollector(
|
||||
declaration.getter?.symbol?.let { expectActualMap[it] = actualProperty.getter!!.symbol }
|
||||
declaration.setter?.symbol?.let { expectActualMap[it] = actualProperty.setter!!.symbol }
|
||||
}
|
||||
} else if (!declaration.parent.containsOptionalExpectation()) {
|
||||
} else if (!declaration.parent.containsOptionalExpectation() && !(declaration is IrConstructor && declaration.isPrimary)) {
|
||||
diagnosticsReporter.reportMissingActual(declaration)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
<!NO_ACTUAL_FOR_EXPECT{JVM}!>expect enum class Foo {
|
||||
ENTRY
|
||||
}<!>
|
||||
|
||||
expect enum class _TimeUnit
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual typealias Foo = FooImpl
|
||||
|
||||
actual typealias _TimeUnit = java.util.concurrent.TimeUnit
|
||||
|
||||
// FILE: FooImpl.java
|
||||
|
||||
public enum FooImpl {
|
||||
ENTRY("OK") {
|
||||
@Override
|
||||
public String getResult() {
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
protected final String value;
|
||||
|
||||
public FooImpl(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public abstract String getResult();
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
<!NO_ACTUAL_FOR_EXPECT{JVM}!>expect enum class Foo {
|
||||
ENTRY1,
|
||||
ENTRY2,
|
||||
ENTRY3;
|
||||
}<!>
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual enum class Foo(val x: String) {
|
||||
ENTRY1("1"),
|
||||
ENTRY2("2"),
|
||||
ENTRY3("3");
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ expect annotation class Foo2
|
||||
expect annotation class Foo3
|
||||
expect annotation class Foo4
|
||||
expect annotation class Foo5()
|
||||
expect annotation class Foo6<!NO_ACTUAL_FOR_EXPECT{JVM}!>()<!>
|
||||
expect annotation class Foo7<!NO_ACTUAL_FOR_EXPECT{JVM}!>()<!>
|
||||
expect annotation class Foo6()
|
||||
expect annotation class Foo7()
|
||||
|
||||
@<!UNRESOLVED_REFERENCE!>Foo1<!>
|
||||
fun foo() {}
|
||||
|
||||
+3
-3
@@ -5,9 +5,9 @@ expect class Foo1
|
||||
expect class Foo2
|
||||
expect class Foo3
|
||||
|
||||
expect class Bar1<!NO_ACTUAL_FOR_EXPECT{JVM}!>()<!>
|
||||
expect class Bar2<!NO_ACTUAL_FOR_EXPECT{JVM}!>()<!>
|
||||
expect class Bar3<!NO_ACTUAL_FOR_EXPECT{JVM}!>()<!>
|
||||
expect class Bar1()
|
||||
expect class Bar2()
|
||||
expect class Bar3()
|
||||
expect class Bar4()
|
||||
expect class Bar5()
|
||||
expect class Bar6()
|
||||
|
||||
Reference in New Issue
Block a user