[FIR] Reproduce #KT-58939
This commit is contained in:
committed by
Space Team
parent
cf2ef443f4
commit
bc602b3827
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
FILE: enumWithTheSameNameAsEntry.kt
|
||||
public final enum class A : R|kotlin/Enum<A>| {
|
||||
private constructor(): R|A| {
|
||||
super<R|kotlin/Enum<A>|>()
|
||||
}
|
||||
|
||||
public final static enum entry A: R|A|
|
||||
public final static enum entry B: R|A|
|
||||
public final static fun values(): R|kotlin/Array<A>| {
|
||||
}
|
||||
|
||||
public final static fun valueOf(value: R|kotlin/String|): R|A| {
|
||||
}
|
||||
|
||||
public final static val entries: R|kotlin/enums/EnumEntries<A>|
|
||||
public get(): R|kotlin/enums/EnumEntries<A>|
|
||||
|
||||
}
|
||||
public final fun test(a: R|A|): R|kotlin/Unit| {
|
||||
^test when (R|<local>/a|) {
|
||||
==($subj$, R|/A.A|.<Unresolved name: A>#) -> {
|
||||
String(A)
|
||||
}
|
||||
==($subj$, R|/A.A|.<Unresolved name: B>#) -> {
|
||||
String(B)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// LANGUAGE: +ContextSensitiveEnumResolutionInWhen
|
||||
// KT-58939
|
||||
|
||||
enum class A {
|
||||
A,
|
||||
B,
|
||||
}
|
||||
|
||||
fun test(a: A) = <!NO_ELSE_IN_WHEN!>when<!> (a) {
|
||||
A.<!UNRESOLVED_REFERENCE!>A<!> -> "A"
|
||||
A.<!UNRESOLVED_REFERENCE!>B<!> -> "B"
|
||||
}
|
||||
Reference in New Issue
Block a user