I see that `import Foo.Companion.bar` works, but A...
# scripting
t
I see that
import Foo.Companion.bar
works, but Android Studio seems to expect
import Foo_main.Foo.Companion.bar
. What IDE are you all using to write kts? Is there a way to use Android Studio (without a sea of red and no auto-complete)?
i
I guess that this discrepancy will persist until K2 mode lands to AS. If you'll take IJ 24.2 or .3 and enable K2 mode, the highlighting will correspond to the behaviour. Alternatively one can stay with the old behaviour for a while by passing
-language-version 1.9
to the compiler.
gratitude thank you 1
t
I went with the
-language-version 1.9
approach - I changed my shebang to:
Copy code
#!/usr/bin/env kotlin -language-version 1.9
and it works great now. The important behavior is consistent between the IDE and the runtime. Thanks!!