Skip to content

Inner enum declarations cause initialization-checker error #14460

@Xavientois

Description

@Xavientois

Compiler version

3.1.2-RC1

Minimized code

class Outer:
    enum MyEnum {
        case Case
    }

Output

-- Error: tests/init/pos/inner-enum.scala:3:8 --------------------------------------------------------------------------
3 |        case Case
  |        ^
  |        Cannot prove that the value is fully initialized. May only use initialized value as method arguments.
  |
  |        The unsafe promotion may cause the following problem:
  |        Access non-initialized value $values. Calling trace:
  |         -> case Case	[ inner-enum.scala:3 ]

Expectation

When compiling with the -Ysafe-init flag this declaration should pass.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions