Closed as duplicate
Description
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.