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

Make REPL understand package; regression from Scala2 #13595

Closed
bjornregnell opened this issue Sep 23, 2021 · 3 comments
Closed

Make REPL understand package; regression from Scala2 #13595

bjornregnell opened this issue Sep 23, 2021 · 3 comments

Comments

@bjornregnell
Copy link
Contributor

Compiler version

3.0.2

Minimized code and output

scala> package x { def f = 42 }
-- Error:
1 |package x { def f = 42 }
  |^^^^^^^
  |this kind of statement is not allowed here

Expectation

There should, as in Scala 2, be some way to play with code that has packages (also nested):

Welcome to Scala 2.13.6 (OpenJDK 64-Bit Server VM, Java 11.0.11).
Type in expressions for evaluation. Or try :help.

scala> :paste 
// Entering paste mode (ctrl-D to finish)

package X { package X { object X { val x = 42 } } }

// Exiting paste mode, now interpreting.

scala> X.X.X.x
val res0: Int = 42
@michelou
Copy link
Contributor

Related to issue 6367 opened on April 24, 2019.

@smarter
Copy link
Member

smarter commented Sep 23, 2021

Duplicate of lampepfl/dotty-feature-requests#131

@bjornregnell
Copy link
Contributor Author

Aha. Missed that despite searching for package and repl. Thanks.

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

3 participants