Resolve lateinit variables
Do not report UNINITIALIZED_VARIABLE on lateinit variables Provide delegating constructors for descriptors for compatibility.
This commit is contained in:
+1
-1
@@ -111,7 +111,7 @@ class JvmSharedVariablesManager(val builtIns: KotlinBuiltIns) : SharedVariablesM
|
||||
LocalVariableDescriptor(
|
||||
variableDescriptor.containingDeclaration, variableDescriptor.annotations, variableDescriptor.name,
|
||||
getSharedVariableType(variableDescriptor.type),
|
||||
false, false, variableDescriptor.source
|
||||
false, false, variableDescriptor.isLateInit, variableDescriptor.source
|
||||
)
|
||||
|
||||
override fun defineSharedValue(sharedVariableDescriptor: VariableDescriptor, originalDeclaration: IrVariable): IrStatement {
|
||||
|
||||
@@ -136,6 +136,7 @@ class IrLocalDelegatedPropertyDelegateDescriptorImpl(
|
||||
|
||||
override fun getCompileTimeInitializer(): ConstantValue<*>? = null
|
||||
override fun isVar(): Boolean = false
|
||||
override fun isLateInit(): Boolean = false
|
||||
override fun substitute(substitutor: TypeSubstitutor): VariableDescriptor? = throw UnsupportedOperationException()
|
||||
override fun getVisibility(): Visibility = Visibilities.LOCAL
|
||||
|
||||
|
||||
+2
@@ -44,6 +44,8 @@ class IrTemporaryVariableDescriptorImpl(
|
||||
|
||||
override fun isVar(): Boolean = isMutable
|
||||
|
||||
override fun isLateInit(): Boolean = false
|
||||
|
||||
override fun <R, D> accept(visitor: DeclarationDescriptorVisitor<R, D>, data: D): R =
|
||||
visitor.visitVariableDescriptor(this, data)
|
||||
}
|
||||
Reference in New Issue
Block a user