[JS IR BE] Fix warnings

This commit is contained in:
Roman Artemev
2019-04-25 15:11:02 +03:00
committed by romanart
parent 867e39f73c
commit 6729603ac7
6 changed files with 14 additions and 12 deletions
@@ -80,7 +80,7 @@ class BridgesConstruction(val context: JsIrBackendContext) : ClassLoweringPass {
continue
}
if (from.function.correspondingProperty != null && from.function.isEffectivelyExternal()) {
if (from.function.correspondingPropertySymbol != null && from.function.isEffectivelyExternal()) {
// TODO: Revisit bridges from external properties
continue
}
@@ -201,7 +201,7 @@ class CallableReferenceLowering(val context: JsIrBackendContext) : FileLoweringP
// }
val arity = propertyReference.type.arity
val factoryName = createPropertyFactoryName(getterDeclaration.correspondingProperty!!)
val factoryName = createPropertyFactoryName(getterDeclaration.correspondingPropertySymbol!!.owner)
val factoryFunction = buildFactoryFunction(propertyReference.getter!!.owner, propertyReference, factoryName)
val getterFunction = propertyReference.getter?.let { buildClosureFunction(it.owner, factoryFunction, propertyReference, arity) }!!
@@ -243,7 +243,7 @@ class CallableReferenceLowering(val context: JsIrBackendContext) : FileLoweringP
putValueArgument(
2, JsIrBuilder.buildString(
context.irBuiltIns.stringType,
getReferenceName(getterDeclaration.correspondingProperty!!)
getReferenceName(getterDeclaration.correspondingPropertySymbol!!.owner)
)
)
}
@@ -150,7 +150,7 @@ class PrivateMembersLowering(val context: JsIrBackendContext) : ClassLoweringPas
).also {
descriptor.bind(it)
it.parent = parent
it.correspondingProperty = correspondingProperty
it.correspondingPropertySymbol = correspondingPropertySymbol
}
}
@@ -199,7 +199,7 @@ class ThrowableSuccessorsLowering(val context: JsIrBackendContext) : FileLowerin
val name = fakeAccessor.name
val function = JsIrBuilder.buildFunction(name, fakeAccessor.returnType, fakeAccessor.parent).apply {
overriddenSymbols += fakeAccessor.overriddenSymbols
correspondingProperty = fakeAccessor.correspondingProperty
correspondingPropertySymbol = fakeAccessor.correspondingPropertySymbol
dispatchReceiverParameter = fakeAccessor.dispatchReceiverParameter?.copyTo(this)
}
@@ -77,10 +77,10 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoidW
}
private fun getFunctionDeclaration(symbol: IrFunctionSymbol): IrFunction {
val descriptor = symbol.descriptor.original
val languageVersionSettings = context.configuration.languageVersionSettings
// TODO: Remove these hacks when coroutine intrinsics are fixed.
return when {
// val descriptor = symbol.descriptor.original
// val languageVersionSettings = context.configuration.languageVersionSettings
// // TODO: Remove these hacks when coroutine intrinsics are fixed.
// return when {
// descriptor.isBuiltInIntercepted(languageVersionSettings) ->
// error("Continuation.intercepted is not available with release coroutines")
//
@@ -89,9 +89,11 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoidW
//
// descriptor == context.ir.symbols.coroutineContextGetter ->
// context.ir.symbols.konanCoroutineContextGetter.owner
//
// else -> (symbol.owner as? IrSimpleFunction)?.resolveFakeOverride() ?: symbol.owner
// }
else -> (symbol.owner as? IrSimpleFunction)?.resolveFakeOverride() ?: symbol.owner
}
return (symbol.owner as? IrSimpleFunction)?.resolveFakeOverride() ?: symbol.owner
}
private val inlineConstructor = FqName("kotlin.native.internal.InlineConstructor")
@@ -54,7 +54,7 @@ class JsClassGenerator(private val irClass: IrClass, val context: JsGenerationCo
classModel.preDeclarationBlock.statements += generateInheritanceCode()
}
is IrSimpleFunction -> {
properties.addIfNotNull(declaration.correspondingProperty)
properties.addIfNotNull(declaration.correspondingPropertySymbol?.owner)
generateMemberFunction(declaration)?.let { classBlock.statements += it }
}
is IrClass -> {