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

REPL does not consider fewerBraces for deciding when input ends #15718

Closed
odersky opened this issue Jul 21, 2022 · 2 comments
Closed

REPL does not consider fewerBraces for deciding when input ends #15718

odersky opened this issue Jul 21, 2022 · 2 comments

Comments

@odersky
Copy link
Contributor

odersky commented Jul 21, 2022

Compiler version

Scala 3.2.0-RC2

Minimized example

scala> import language.experimental.fewerBraces
                                                                                                  
scala> val x: Option[Int] = Some(1)
     | 
val x: Option[Int] = Some(1)
                                                                                                  
scala> x.fold:
val res0: (=> Any) => (Int => Any) => Any = Lambda$68352/733603257@523cb0f9

Output

The REPL returns a result after the :

Expectation

It should accept an argument on the next line.

Another Example:

If I try to put the expression in an object, it fails elsewhere:

scala> object Test:
     |   x.fold:
     |     22
     |   .apply: n =>
-- Error: ----------------------------------------------------------------------
4 |  .apply: n =>
  |            ^^
  |            end of statement expected but '=>' found

Expectation is again that it should let me continue after the =>.

@odersky odersky added stat:needs triage Every issue needs to have an "area" and "itype" label itype:bug area:repl and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 21, 2022
@odersky odersky changed the title REPL does not consider fewerBraces when deciding when input ends REPL does not consider fewerBraces for deciding when input ends Jul 21, 2022
@griggt
Copy link
Collaborator

griggt commented Jul 22, 2022

The first example looks like a duplicate of #13097.

@Kordyjan Kordyjan added this to the Future versions milestone Dec 12, 2022
@odersky
Copy link
Contributor Author

odersky commented Dec 14, 2022

I think this was fixed in #16466.

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