Skip to content

Compiler fails to synthesize ValueOf for singleton this.type #23086

Closed
@rcano

Description

@rcano

Compiler version

3.6.x, 3.7.0-RC4

Minimized code

class Test { summon[ValueOf[this.type]] }

Output

-- [E172] Type Error: ----------------------------------------------------------
1 |class Test { summon[ValueOf[this.type]] }
  |                                       ^
  |No singleton value available for (Test.this : Test); eligible singleton types for `ValueOf` synthesis include literals and stable paths.
1 error found

Expectation

This a singleton type with a singleton value that can only ever be created in exactly one way. The compiler should be able to synthesize this like it does for any other singleton value

Metadata

Metadata

Assignees

Labels

itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" label

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions