Previously (M2) in IrGenerationExtension I was able to scan all module dependecies using ModuleDescriptor.allDependencyModules, select needed classes, reference them using pluginContext.symbolTable.referenceClass(ClassDescriptor) and generate needed expressions with them.
How can I do it in M3 in IR phase?
Now in M3 it complains with list of unbound symbols.
I need all IrClasses from dependency modules. It would be even better to scan using only Ir structures without use of Descriptors.
s
shikasd
07/10/2020, 9:02 PM
I think you can use
IrPluginContext.referenceClass
?
p
PHondogo
07/10/2020, 9:22 PM
Yes, I'm doing this way but got unbound symbols SomeClass.<init>. And I see this error only for abstract classes.
PHondogo
07/10/2020, 9:24 PM
Unbound public symbol for public Test.<init>|8806958854609303196[0] public Test.<init>|8806958854609303196[0]
at org.jetbrains.kotlin.ir.util.SymbolTableKt.noUnboundLeft(SymbolTable.kt:962)
at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:73)
at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile$default(compiler.kt:48)
at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:221)
at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:181)
at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:74)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:86)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1549)
at jdk.internal.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:830)
s
shikasd
07/10/2020, 9:24 PM
Seems like it was not fixed when those API were introduced.
Maybe you could report a bug, I think JB team could fix it.
👌 1
p
PHondogo
07/10/2020, 9:47 PM
I'll try to write some snippet to reproduce first. Also find out that if explicitly apply round bracket to class (primary constructor) it is bounded.