[IR] Fix fake override checkers
This commit is contained in:
@@ -65,7 +65,7 @@ val IrValueParameter.isVararg get() = this.varargElementType != null
|
||||
|
||||
val IrFunction.isSuspend get() = this is IrSimpleFunction && this.isSuspend
|
||||
|
||||
val IrFunction.isReal get() = this.origin != IrDeclarationOrigin.FAKE_OVERRIDE
|
||||
val IrFunction.isReal get() = !(this is IrSimpleFunction && isFakeOverride)
|
||||
|
||||
fun IrSimpleFunction.overrides(other: IrSimpleFunction): Boolean {
|
||||
if (this == other) return true
|
||||
|
||||
@@ -386,11 +386,13 @@ fun IrAnnotationContainer.hasAnnotation(symbol: IrClassSymbol) =
|
||||
val IrConstructor.constructedClassType get() = (parent as IrClass).thisReceiver?.type!!
|
||||
|
||||
fun IrFunction.isFakeOverriddenFromAny(): Boolean {
|
||||
if (origin != IrDeclarationOrigin.FAKE_OVERRIDE) {
|
||||
val simpleFunction = this as? IrSimpleFunction ?: return false
|
||||
|
||||
if (!simpleFunction.isFakeOverride) {
|
||||
return (parent as? IrClass)?.thisReceiver?.type?.isAny() ?: false
|
||||
}
|
||||
|
||||
return (this as IrSimpleFunction).overriddenSymbols.all { it.owner.isFakeOverriddenFromAny() }
|
||||
return simpleFunction.overriddenSymbols.all { it.owner.isFakeOverriddenFromAny() }
|
||||
}
|
||||
|
||||
fun IrCall.isSuperToAny() = superQualifierSymbol?.let { this.symbol.owner.isFakeOverriddenFromAny() } ?: false
|
||||
|
||||
Reference in New Issue
Block a user