Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

TypeCastException: null cannot be cast to non-null type org.jetbrains.kotlin.ir.symbols.IrValueSymbol #1777

Closed
soywiz opened this issue Jul 8, 2018 · 3 comments
Assignees

Comments

@soywiz
Copy link
Contributor

soywiz commented Jul 8, 2018

 * Compiler version info: Konan: 0.8-rc1-2712 / Kotlin: 1.2.70
 * Output kind: PROGRAM

exception: kotlin.TypeCastException: null cannot be cast to non-null type org.jetbrains.kotlin.ir.symbols.IrValueSymbol
        at org.jetbrains.kotlin.ir.util.IrUnboundSymbolReplacer.visitGetValue(IrUnboundSymbolReplacer.kt:474)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitGetValue(IrElementTransformerVoid.kt:149)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitGetValue(IrElementTransformerVoid.kt:24)
        at org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl.accept(IrGetValueImpl.kt:49)
        at org.jetbrains.kotlin.ir.expressions.IrExpression$DefaultImpls.transform(IrExpression.kt:27)

Reproduced here:
https://github.com/kpspemu/kpspemu/tree/knative.problem1
with ./gradlew :kpspemu-native:check

soywiz added a commit to soywiz-archive/kpspemu that referenced this issue Jul 8, 2018
@soywiz
Copy link
Contributor Author

soywiz commented Jul 8, 2018

After using source files and adding some prints, I found the issue and circumvented it:
soywiz-archive/kpspemu@8051303#diff-9878b7bab7893488c170faa977ce1949R1177

Though in this case for the inline I'm using a lambda, and it would have a performance impact.

@olonho
Copy link
Contributor

olonho commented Jul 10, 2018

Seems problem somehow related to substitution of value-parameter srcSize: kotlin.Int = ... by inliner into setVD_VSVT, i.e. we failed to replace parameter with its value, if the value is default one.

@homuroll
Copy link
Contributor

Fixed in master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants