Skip to content

Regression in parser for refined givens #21958

Closed as not planned
Closed as not planned
@WojciechMazur

Description

@WojciechMazur

Regression found during work on fix for other parser regression in #21957

Compiler version

Last good release: 3.5.0-RC1-bin-20240506-1cdf99f-NIGHTLY
First bad release: 3.5.0-RC1-bin-20240508-b10d64e-NIGHTLY

Bisect points it could have been introduced by either ea3c688 or 5189e68

Minimized code

trait Foo[T]:
  def foo(v: T): Unit

given myFooOfUnit: Foo[Unit]{ type X = Int } = new Foo[Unit] {
    type X = Int
    def foo(v: Unit): Unit = ???
  }

@main def Test = 
  summon[Foo[Unit]{type X = Int}]

Output

[error] ./tmp.scala:5:29
[error] 'with' expected, but '{' found
[error] given myFooOfUnit: Foo[Unit]{ type X = Int } = new Foo[Unit] {
[error]                             ^
[error] ./tmp.scala:11:34
[error] '}' expected, but eof found
[error]   summon[Foo[Unit]{type X = Int}]
[error]                     

Expectation

Should compile

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions