Hi, I'm rewriting my plugin written in Kotlin 1.3 ...
# compiler
j
Hi, I'm rewriting my plugin written in Kotlin 1.3 with Java bytecode generation to Kotlin 1.4 with IR generation. Unfortunately my
SyntheticResolveExtension
stopped working and it throws following error:
Copy code
e: java.lang.IllegalArgumentException: Unbound type parameters are forbidden: [Unbound private symbol org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl@45e9c41b]
	at org.jetbrains.kotlin.ir.util.ExternalDependenciesGenerator.generateUnboundSymbolsAsDependencies(ExternalDependenciesGenerator.kt:36)
	at org.jetbrains.kotlin.psi2ir.generators.ModuleGenerator.generateUnboundSymbolsAsDependencies(ModuleGenerator.kt:62)
I'm creating type parameters with
TypeParameterDescriptorImpl.createWithDefaultBound
, so I wasn't expecting any issues with bounds - especially, because it was working before. Is it known issue? I can create sample reproduction project if it's required.
s
Hey, I assume this issue is not about type bounds, but rather about how IR works internally. Essentially, most of IR elements have a
symbol
which keeps reference to the
descriptor
from frontend. Those symbols are
bound
to actual IR types, so that you could retrieve them using
owner
property. However, I am not quite sure why they are not bound when you are creating them with
SyntheticResolve
, maybe worth filing a bug to JB with a repro case :)
r
Hi, Andrei is right, it is about IR, not super bounds. Could you please show how do you create type parameter and what declaration that TP belongs to?
j
For some reason for public symbol toString is much nicer
Copy code
e: java.lang.AssertionError: Unbound symbols not allowed
	Unbound public symbol for public /MyClass.duplicate.<get-duplicate>|8325396290023284181[0]
https://youtrack.jetbrains.com/issue/KT-41006 - I've created issue on YouTrack
r
As I can see synthetic properties are not properly supported yet in our IR infra. There is some work in front end has to be done. Will try to fix and push it next (probably 1.4.20) version. Thanks for report
👍 2