Skip to content

REPL: directory under current directory shadows REPL-defined identifier #7699

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

Closed
SethTisue opened this issue Dec 9, 2019 · 2 comments
Closed

Comments

@SethTisue
Copy link
Member

this seems surprising and wrong, and quite difficult to troubleshoot if you don't think to look in the filesystem for an explanation:

% mkdir foo
% dotr
Starting dotty REPL...
scala> def foo = 3
def foo: Int

scala> foo                                                                                                              
1 |foo
  |^^^
  |package foo is not a value

whereas in Scala 2:

scala 2.13.1> foo
              ^
              error: package foo is not a value

scala 2.13.1> def foo = 3
foo: Int

scala 2.13.1> foo
res1: Int = 3

(aside: I mentioned to Martin that I remembered a similar Scala 2 ticket or PR, but after about 10 minutes of digging just now I failed to find it and gave up)

@SethTisue
Copy link
Member Author

gah! duplicate of #7635

@som-snytt
Copy link
Contributor

You have to get up pretty early in the morning to beat Seth to the old random directory in current directory results in surprising behavior ticket.

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

No branches or pull requests

2 participants