Kotlin script .kts not recognise imported class from .kt file

Answered

Hi,

As shown in the attachment, in my .kts file, I import a class from a .kt file.

While I can run the code from command line, the IDE doesn't recognise the imported class from the .kt file.

Could you please offer some help here? Thanks!

IDE info:
IntelliJ IDEA 2021.2 (Ultimate Edition)
Build #IU-212.4746.92, built on July 27, 2021

Kotlin: 212-1.5.10-release-IJ4746.92

/ Yong

0
4 comments

It is a known issue unfortunately. Please vote for it in our tracker: KTIJ-16352 IDE: unresolved reference when trying to import file in main.kts scripts with @Import annotation

0

Thank you, Andrey Dernov!
BTW, do you know where can I find the latest status of Kotlin's scripting feature? Thanks!

/ Yong

0

Could you please clarify, do you mean some specific feature? Thanks.

0

Thanks again, Andrey Dernov! I was referring to the overall feature of "Kotlin as a scripting language", if I put it that way. 

And I think I've found the answer from here: https://github.com/Kotlin/KEEP/blob/master/proposals/scripting-support.md#implementation-status

Have a nice day!

/ Yong

0

Please sign in to leave a comment.