I’m getting the following exception when building....
# kotlin-native
t
I’m getting the following exception when building. This happened after adding code to my project. I was able to narrow it down to a piece of code, but I cannot reproduce it in a sample project. Could anyone explain to me what this error means so I can find the cause? EDIT: I have enabled the new Objective C generics using
-Xobjc-generics
in my project. If I disable that then the issue is gone. Looks like this is a bug with the new generics.
d
Looks like someone put a
TODO()
somewhere and hasn't removed it.
j
You could run the kotlin compiler in debug mode to see more context. I did this to find the issue behind another crash earlier today. I described it in this comment: https://github.com/JetBrains/kotlin-native/issues/2864#issuecomment-504641546
t
@Jurriaan Mous Thanks for the description. I am trying to run it but my arguments are too long for IntelliJ. (it throws an error, argument list too long). Any ideas?
j
No clue. For me it did run without a problem. Probably I have a less long argument list.
t
The bug disappeared for some reason after adding an empty
run
block to the end of a suspend lambda.
s
I am trying to run it but my arguments are too long for IntelliJ. (it throws an error, argument list too long).
You can use “Remote” Run/Debug configuration in IntelliJ IDEA. Its configuration provides “Command line arguments for remove JVM” to be passed to Kotlin/Native compiler. This can be achieved using
JAVA_OPTS
environment variable, e.g.
Copy code
JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"  ~/.konan/kotlin-native-macos-1.3/bin/kotlinc-native <your args here>
Then you can attach to the process with IDEA debugger by running the “Remote” configuration.
t
I’m unable to reproduce the issue right now. If the issue returns I will try out your suggestion. Thanks!
👍 1