Open
Description
Compiler version
Latest dotty on Scastie (3.2.0-RC1)
Minimized code
enum MyEnum {
case class Foo(n: Int)
case Constructor(field: Foo)
}
Output
enum MyEnum {
case class Foo(n: Int)
case Constructor(field: Foo)
// Not found: type Foo ^^^
}
Expectation
If definitions within enums cannot be referred to, they should be forbidden. The error message in this case should be something along the lines of:
enum MyEnum {
case class Foo(n: Int)
// case class definitions in enum not allowed.
case Constructor(field: Foo)
}