IR metadata source: do not require descriptor in property metadata
This commit is contained in:
+3
-3
@@ -660,7 +660,7 @@ class Fir2IrDeclarationStorage(
|
||||
it.populateOverriddenSymbols(thisReceiverOwner)
|
||||
}
|
||||
}.apply {
|
||||
metadata = FirMetadataSource.Property(property, descriptor)
|
||||
metadata = FirMetadataSource.Property(property)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -708,7 +708,7 @@ class Fir2IrDeclarationStorage(
|
||||
isExpect = property.isExpect,
|
||||
isFakeOverride = origin == IrDeclarationOrigin.FAKE_OVERRIDE
|
||||
).apply {
|
||||
metadata = FirMetadataSource.Variable(property, descriptor)
|
||||
metadata = FirMetadataSource.Variable(property)
|
||||
enterScope(this)
|
||||
if (irParent != null) {
|
||||
parent = irParent
|
||||
@@ -794,7 +794,7 @@ class Fir2IrDeclarationStorage(
|
||||
isStatic = field.isStatic,
|
||||
isFakeOverride = false
|
||||
).apply {
|
||||
metadata = FirMetadataSource.Variable(field, descriptor)
|
||||
metadata = FirMetadataSource.Variable(field)
|
||||
descriptor.bind(this)
|
||||
fieldCache[field] = this
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.backend
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.declarations.MetadataSource
|
||||
@@ -44,17 +43,22 @@ interface FirMetadataSource : MetadataSource {
|
||||
}
|
||||
|
||||
class Property(
|
||||
val property: FirProperty, descriptor: PropertyDescriptor
|
||||
) : MetadataSource.Property(descriptor), FirMetadataSource {
|
||||
val property: FirProperty
|
||||
) : FirMetadataSource {
|
||||
override val session: FirSession
|
||||
get() = property.session
|
||||
|
||||
override val name: Name
|
||||
get() = property.name
|
||||
}
|
||||
|
||||
class Variable(
|
||||
val variable: FirVariable<*>,
|
||||
descriptor: PropertyDescriptor
|
||||
) : MetadataSource.Property(descriptor), FirMetadataSource {
|
||||
val variable: FirVariable<*>
|
||||
) : FirMetadataSource {
|
||||
override val session: FirSession
|
||||
get() = variable.session
|
||||
|
||||
override val name: Name
|
||||
get() = variable.name
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user