Is this a Kotlin/JS compiler bug? ```e: java.lang...
# multiplatform
k
Is this a Kotlin/JS compiler bug?
Copy code
e: java.lang.AssertionError: typeParameters = [] size != typeArguments = [org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl@ccfbb239, org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl@6b488739] size 
        at org.jetbrains.kotlin.ir.overrides.IrOverridingUtilKt.buildFakeOverrideMember(IrOverridingUtil.kt:70)
        at org.jetbrains.kotlin.ir.overrides.FakeOverrideBuilderStrategy.fakeOverrideMember(IrOverridingUtil.kt:28)
        at org.jetbrains.kotlin.ir.overrides.IrOverridingUtil.buildFakeOverridesForClass(IrOverridingUtil.kt:148)
        at org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder.buildFakeOverrideChainsForClass(FakeOverrides.kt:104)
        at org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder.provideFakeOverrides(FakeOverrides.kt:166)
        at org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder.provideFakeOverrides(FakeOverrides.kt:174)
        at org.jetbrains.kotlin.backend.common.serialization.KotlinIrLinker.postProcess(KotlinIrLinker.kt:207)
        at org.jetbrains.kotlin.ir.backend.js.KlibKt.loadIr(klib.kt:351)
        at org.jetbrains.kotlin.ir.backend.js.KlibKt.loadIr$default(klib.kt:232)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:97)
        at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile$default(compiler.kt:42)
        at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:306)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:182)
        at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:75)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
        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:1574)
        at jdk.internal.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        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(Native Method)
        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(Native Method)
        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:829)
I feel like it should be giving me more information on where the error exists. If it is, I can report it on youtrack
The issue was that I had accidentally added some generic parameters to a class which isn't parameterized
g
Do you use IntelliJ ? IDE should at least show this error. Otherwise I agree the log could be a bit more user friendly 😄
k
I do use the IDE. This error is hard to diagnose when compiling from the command line though. In huge projects, this IDE error doesn't surface until you figure out what file is experiencing the problem and open it
👍 1
r
The error here isn't so much that your code is wrong, it's that the compiler didn't catch it in the frontend and told the backend to generate invalid code. If everything works you should never see
org.jetbrains.kotlin.backend.
in error stacktraces
today i learned 1
k
Today I learned!