FIR: Provide dispatch receiver for 'field' according to property type

This commit is contained in:
Jinseong Jeon
2020-03-27 22:31:44 -07:00
committed by Mikhail Glukhikh
parent a0978a50e8
commit 078cf02c8a
32 changed files with 39 additions and 34 deletions
@@ -11,9 +11,17 @@ import org.jetbrains.kotlin.name.Name
// NB: with className == null we are at top level
data class CallableId(val packageName: FqName, val className: FqName?, val callableName: Name) {
val classId: ClassId? get() = className?.let { ClassId(packageName, it, false) }
var classId: ClassId? = null
get() {
if (field == null && className != null) {
field = ClassId(packageName, className, false)
}
return field
}
constructor(classId: ClassId, callableName: Name) : this(classId.packageFqName, classId.relativeClassName, callableName)
constructor(classId: ClassId, callableName: Name) : this(classId.packageFqName, classId.relativeClassName, callableName) {
this.classId = classId
}
constructor(packageName: FqName, callableName: Name) : this(packageName, null, callableName)