Skip to content

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

Closed
@odersky

Description

@odersky

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 =>.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions