Skip to content

Cannot write type members in phantom types #3121

Closed
@nicolasstucki

Description

@nicolasstucki

As found in #2040

object MyPhantom extends Phantom {
  type Foo = this.Any { type Member = Int }
}

will fail with

  type Foo = this.Any { type Member = Int }
             ^^^^^^^^
illegal trait inheritance: superclass Object does not derive from trait Any's super<nonsensical><none></nonsensical>

The issue probably that there is an Object added to the type of this.Any { type Member = Int } when desugaring.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions