Are scripts supposed to work in Kotlin 2.0.0? ```e...
# scripting
r
Are scripts supposed to work in Kotlin 2.0.0?
Copy code
error: backend Internal error: Exception during IR lowering
File being compiled: /Users/ribesg/Projects/kotlin-scripts/playground.main.kts
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:50) (playground.main.kts): org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /Users/ribesg/Projects/kotlin-scripts/playground.main.kts
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:50)
kodee sad 2
This seems to happen if I use
__FILE__
. Also, in IntelliJ every time I make a change in a script (including adding a single character) the IDE freezes for 5 seconds. For every character.
A simple file seems to work for me with
2.0.0-release-341
Copy code
#!/usr/bin/env kotlin
println(__FILE__)
But there are a bunch of youtracks about scripting and IDE support so I wouldn’t be surprised things are missing
i
@ribesg. it supposed to work. Please file an issue with the particular usage that fails for you.
r
I opened an issue with the blocking problem I have (and a lot of logs) https://youtrack.jetbrains.com/issue/IDEA-354469/IntelliJ-IDEA-freezes-for-5-15s-for-every-change-while-editing-Kotlin-script I would do more testing with the
__FILE__
problem and try to make a simple reproducer, but I just can't use the IDE with scripts right now so it's impossible
thank you color 1
m
@ribesg somehow this link brings me to a 404 page
r
The issue somehow was set as private. The attached logs are set as private as I don't know what they could contain, I guess it made the issue private too, idk. Edit: made the issue public
m
Interesting. IIRC you can do it only for attachment
r
I can add you to the allowed users for the attachment if you give me the handle you use (looks like you have 3 accounts on there 😄) I just don't want it to be fully public
m
Username is
martinbonnin
. TIL I had 2 others maybe I should check in there 😅
r
Yup, you should have access
thank you color 1
1
m
(trying to delete those SSO accounts...)
r
I managed to use a workaround to "force" Fleet to actually read the file and I think it has a similar issue, I edited the issue and added Fleet logs. The issue does not freeze the UI on Fleet though, it just showed a saving loader for like 2 minutes. I need to check if it actually manages to save the file, but if it does I might be able to work on my script. Looks like it's saving. I don't really know what's happening but I can work