raulraja
03/23/2020, 1:53 PMkotlin.internal.ir.Intrinsic
. I suppose this is an issue in code generation and not that I actually need an IR runtime to run that code and it’s missing as dependency. Is that the case? Or does anyone else know where this may be coming from? Any help is appreciated, thanks!
Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/internal/ir/Intrinsic
at consumer.MainKt.<clinit>(main.kt:5)
Caused by: java.lang.ClassNotFoundException: kotlin.internal.ir.Intrinsic
at <http://java.net|java.net>.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
shikasd
03/23/2020, 3:02 PMIrFile
some time ago. Maybe it is related.raulraja
03/25/2020, 5:04 PMshikasd
03/25/2020, 5:49 PMraulraja
03/25/2020, 6:18 PM2: invokestatic #48 // Method twitterHandle:(Ljava/lang/String;)Ltest/TwitterHandle;
2: invokestatic #50 // Method kotlin/internal/ir/Intrinsic.twitterHandle:(Ljava/lang/String;)Ltest/TwitterHandle;
twitterHandle
functions is inside a class called kotlin/internal/ir/Intrinsic
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:test.TwitterHandle? visibility:private [final,static]
EXPRESSION_BODY
CALL 'public final fun twitterHandle (): test.TwitterHandle? declared in test' type=test.TwitterHandle? origin=null
$receiver: CONST String type=kotlin.String value="@admin"
shikasd
03/25/2020, 6:41 PMcompanion object {
val FAKE_OWNER_TYPE = Type.getObjectType("kotlin/internal/ir/Intrinsic")
}
No other mentions of that guy anywhere elsefun mapToCallableMethod(expression: IrFunctionAccessExpression): IrCallableMethod {
val callee = expression.symbol.owner.getOrCreateSuspendFunctionViewIfNeeded(context)
val calleeParent = callee.parent
if (calleeParent !is IrClass) {
// Non-class parent is only possible for intrinsics created in IrBuiltIns, such as dataClassArrayMemberHashCode. In that case,
// we still need to return some IrCallableMethod with some owner instance, but that owner will be ignored at the call site.
// Here we return a fake type, but this needs to be refactored so that we never call mapToCallableMethod on intrinsics.
// TODO: get rid of fake owner here
return IrCallableMethod(FAKE_OWNER_TYPE, Opcodes.INVOKESTATIC, mapSignatureSkipGeneric(callee), false)
}
raulraja
03/25/2020, 7:52 PMshikasd
03/25/2020, 8:02 PMfunction is not declared
. Apparently, it is not in the symbol table?
fun FunctionDescriptor.irCall(): IrCall {
val irFunctionSymbol = backendContext.ir.symbols.externalSymbolTable.referenceDeclaredFunction(this)
return IrCallImpl(
startOffset = UNDEFINED_OFFSET,
endOffset = UNDEFINED_OFFSET,
type = irFunctionSymbol.owner.returnType,
symbol = irFunctionSymbol,
descriptor = irFunctionSymbol.descriptor,
typeArgumentsCount = irFunctionSymbol.owner.descriptor.typeParameters.size,
valueArgumentsCount = irFunctionSymbol.owner.descriptor.valueParameters.size
)
}
jvmPhases
, lowering replaces function parent for generationFileClassLowering
or something like that`synthetic()
in
fun List<Proof>.synthetic(): List<Proof> =
mapNotNull { proof ->
Proof(proof.from, <http://proof.to|proof.to>, (proof.through as SimpleFunctionDescriptor).synthetic(), proof.proofType)
}
and it works 🙂raulraja
03/25/2020, 9:43 PMshikasd
03/26/2020, 2:46 AM