JVM IR: avoid unnecessary toIrBasedKotlinType in ExpressionCodegen

Result of calling `ExpressionCodegen.gen` was used only in two call
sites in the inliner. In all other call sites, we were doing unnecessary
work (and sometimes were even failing) by trying to construct a
KotlinType instance out from an IrType.

Note that even though the code from KT-50617 no longer fails to compile,
the underlying problem is still not solved, since the IrType for foo's
dispatch receiver is constructed incorrectly. The reason is that
SymbolTable links everything by IdSignature, which is identical for
classes with the same FQ name.

 #KT-50617 Fixed
This commit is contained in:
Alexander Udalov
2022-01-18 02:39:09 +01:00
parent 5f22bcd03b
commit f40a0ca704
11 changed files with 72 additions and 4 deletions
@@ -0,0 +1,18 @@
// IGNORE_BACKEND: NATIVE, JS_IR, WASM
// IGNORE_BACKEND_FIR: JVM_IR
// MODULE: lib
// FILE: 1.kt
interface B<X>
object T : B<String>
fun B<*>.foo() {}
// MODULE: main(lib)
// FILE: 2.kt
interface B
fun box(): String {
T.foo()
return "OK"
}