Sergio Pro07/29/2020, 1:16 PM
annotation does not seem to be working for me: `common.main.kts`:
#!/usr/bin/env -S kotlinc -script -- val greeting = "Hello"
Both files are in the same directory and I've tried relative and absolute paths. Am I doing something wrong here? I know it's possible with
#!/usr/bin/env -S kotlinc -script -- @file:org.jetbrains.kotlin.script.util.Import("common.main.kts") print(greeting) // unresolved reference and nothing to import
but I would prefer to keep extra dependencies to a minimum. Doesn't kotlin have built-in support for this and I'm totally misunderstanding what
annotation is supposed to do?
ilya.chernikov07/31/2020, 3:17 PM
annotation should be accessible without FQN in the versions that support it. so it should work as
e.g. here is how it looks in the tests https://github.com/JetBrains/kotlin/blob/1.3.70/libraries/tools/kotlin-main-kts-test/testData/import-test.main.kts
Sergio Pro07/31/2020, 3:18 PM
ilya.chernikov07/31/2020, 3:19 PM