[Expect/Actual] Add ability to skip matching of constructors of expect enums

In terms of MPP there are no such thing as `expect constructor` for enums,
  but they are physically exist in FIR and IR, so we need a switch which
  skips matching for them

FE 1.0 implementation did not touch to avoid any hidden changes
This commit is contained in:
Dmitriy Novozhilov
2023-06-06 17:26:41 +03:00
committed by Space Team
parent ba41e8ec38
commit 8b9079d026
8 changed files with 22 additions and 59 deletions
@@ -1,34 +0,0 @@
// MODULE: m1-common
// FILE: common.kt
<!INCOMPATIBLE_MATCHING{JVM}, INCOMPATIBLE_MATCHING{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
<!INCOMPATIBLE_MATCHING{JVM}, INCOMPATIBLE_MATCHING{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