Skip to content

-Ycheck-init warning with Some(this) #9795

Closed
@japgolly

Description

@japgolly

Minimized code

Dotty ver: 0.27.0-RC1

// compile with -source 3.1 -Ycheck-init
class X:
  val some = Some(this)

Output

[warn] -- Warning:
[warn] 4 |  val some = Some(this)
[warn]   |                  ^^^^
[warn]   |Promote the value under initialization to fully-initialized. Calling trace:
[warn]   | -> val some = Some(this)

Expectation

No warning

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions