IR: do not inherit IrFakeOverride* from IrFunction/IrProperty

This will help to reduce boilerplate after making the latter classes.

Without this change, IrFunctionCommonImpl would not be able to be a
class because it would introduce a diamond class hierarchy, and thus
that would require copying all its contents to IrFunctionImpl and
IrFakeOverrideFunctionImpl.
This commit is contained in:
Alexander Udalov
2020-07-21 22:57:12 +02:00
parent 4892737cc9
commit f240d51d2c
10 changed files with 20 additions and 20 deletions
@@ -17,7 +17,6 @@
package org.jetbrains.kotlin.backend.common.overrides
import org.jetbrains.kotlin.backend.common.serialization.signature.IdSignatureSerializer
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns
import org.jetbrains.kotlin.ir.descriptors.WrappedPropertyDescriptor
@@ -31,9 +30,6 @@ import org.jetbrains.kotlin.ir.types.IrTypeProjection
import org.jetbrains.kotlin.ir.types.extractTypeParameters
import org.jetbrains.kotlin.ir.types.getClass
import org.jetbrains.kotlin.ir.util.SymbolTable
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
import org.jetbrains.kotlin.ir.visitors.acceptVoid
import org.jetbrains.kotlin.types.Variance
interface PlatformFakeOverrideClassFilter {
@@ -124,7 +120,6 @@ class FakeOverrideBuilder(
symbolTable.declareSimpleFunctionFromLinker(WrappedSimpleFunctionDescriptor(), signature) {
declaration.acquireSymbol(it)
declaration
}
}
@@ -136,7 +131,7 @@ class FakeOverrideBuilder(
// To break this loop we use temp symbol in correspondingProperty.
val tempSymbol = IrPropertySymbolImpl(WrappedPropertyDescriptor()).also {
it.bind(declaration)
it.bind(declaration as IrProperty)
}
declaration.getter?.let {
it.correspondingPropertySymbol = tempSymbol
@@ -149,7 +144,6 @@ class FakeOverrideBuilder(
symbolTable.declarePropertyFromLinker(WrappedPropertyDescriptor(), signature) {
declaration.acquireSymbol(it)
declaration
}
declaration.getter?.let {