Skip to content

Definitions in java.lang._ shadow definitions in REPL #11146

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
nicolasstucki opened this issue Jan 18, 2021 · 2 comments · Fixed by #12303
Closed

Definitions in java.lang._ shadow definitions in REPL #11146

nicolasstucki opened this issue Jan 18, 2021 · 2 comments · Fixed by #12303
Assignees
Milestone

Comments

@nicolasstucki
Copy link
Contributor

The current error messages are also not helpful to understand that those definitions are shadowed.

scala> class Compiler
scala> new Compiler
  |        ^^^^^^^^
  |constructor Compiler cannot be accessed as a member of Compiler from module class rs$line$7$.
scala> class Appendable
scala> new Appendable
1 |new Appendable
  |    ^^^^^^^^^^
  |    Appendable is a trait; it cannot be instantiated
scala> class Byte
scala> new Byte
1 |new Byte
  |    ^^^^
  |    Byte is abstract; it cannot be instantiated
scala> class Compiler
scala> new Compiler
  |        ^^^^^^^^
  |constructor Compiler cannot be accessed as a member of Compiler from module class rs$line$7$.
@nicolasstucki
Copy link
Contributor Author

@som-snytt
Copy link
Contributor

REPL definitions should shadow classpath and root contexts.

#7635 (comment)

@griggt griggt self-assigned this Apr 30, 2021
smarter added a commit that referenced this issue May 1, 2021
Fix #11146: Don't re-add root imports to context in REPLFrontEnd
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants