Closed
Description
class Foo(sc: => Int) extends AnyVal
emits the error
2 | class Foo(sc: => Int) extends AnyVal
| ^
| value sc in class Foo does not take parameters
but then stays in an infinite loop.
In scalac it fails with
Foo.scala:2: error: value class parameter must be a val and not be private[this]
In both scalac and dotty
class Foo(val sc: => Int) extends AnyVal
fails correctly with val parameters may not be call-by-name