FIR2IR: fix intersection type smart cast when synthetic property accessed

This commit is contained in:
Mikhail Glukhikh
2021-01-22 09:00:32 +03:00
parent 504bdfc283
commit 1c9064836e
8 changed files with 560 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
interface Substitutable<out T : DeclarationDescriptorNonRoot> {
}
abstract class ResolutionPart {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
abstract fun KotlinResolutionCandidate.process(): String
}
class KotlinResolutionCandidate {
constructor(resolvedCall: Atom) /* primary */ {
super/*Any*/()
/* <init>() */
}
val resolvedCall: Atom
field = resolvedCall
get
}
class Atom {
constructor(candidateDescriptor: CallableDescriptor) /* primary */ {
super/*Any*/()
/* <init>() */
}
val candidateDescriptor: CallableDescriptor
field = candidateDescriptor
get
}
object Owner : ResolutionPart {
private constructor() /* primary */ {
super/*ResolutionPart*/()
/* <init>() */
}
override fun KotlinResolutionCandidate.process(): String {
val candidateDescriptor: CallableDescriptor = <this>.<get-resolvedCall>().<get-candidateDescriptor>()
when {
when {
candidateDescriptor is MemberDescriptor -> EQEQ(arg0 = candidateDescriptor /*as MemberDescriptor */.getModality(), arg1 = null).not()
else -> false
} -> { // BLOCK
return "OK"
}
}
return "FAIL"
}
}
object Final : Modality {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}