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

indentation syntax is confused by commas in extends and derives clause #22528

Closed
mberndt123 opened this issue Feb 5, 2025 · 1 comment
Closed
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label

Comments

@mberndt123
Copy link

mberndt123 commented Feb 5, 2025

Hey,

Here's some simple code:
https://scastie.scala-lang.org/PEqZTW1YTxOOHk4L2zpzHw

trait Bar
trait Baz

def f =
  locally:
    trait Foo extends Bar, Baz

This works fine and defines a trait Foo inside that locally block.

Here's a slightly different version:
https://scastie.scala-lang.org/Tz39YMm4QG2D5PO9zbTD3w

trait Bar
trait Baz

def f =
  identity(
    locally:
      trait Foo extends Bar, Baz
  )

Here, the Scala 3.6.3 compiler reports an error: Not found: Baz

I think this is because it thinks of the comma in the extends clause as a function argument separator for the call to identity. The same problem also affects derives clauses.

@mberndt123 mberndt123 added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 5, 2025
@mberndt123
Copy link
Author

Duplicate of #22527.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label
Projects
None yet
Development

No branches or pull requests

1 participant