Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kscript --interactive does not resolve the variables defined inside .kts file #401

Open
namiq-tahmazli-epam opened this issue Jun 6, 2023 · 1 comment

Comments

@namiq-tahmazli-epam
Copy link

namiq-tahmazli-epam commented Jun 6, 2023

I am trying to repl connect to .kts file which is defined such

#!/usr/bin/env kscript

val myName = "Namig"

and it can not resolve it.
Here is the logs:

kscript --interactive test.kts
[kscript] Creating REPL
Welcome to Kotlin version 1.8.21 (JRE 11.0.12+0)
Type :help for help, :quit for quit
println(myName)
error: unresolved reference: myName
println(myName)

I am thankful in advance for your efforts and creating such a beautiful project which makes
my life easier when writing script.

@aartiPl
Copy link
Collaborator

aartiPl commented Jun 13, 2023

I don't know if-- interactive mode was ever intended to resolve pieces of the code in the script. In my understanding, it is only for resolving dependencies and putting them into the scope of REPL. That functionality definitely works:

obraz

(code based on the example from README)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants