Skip to content

Cannot abstract over erased classes #13428

Open
@nicolasstucki

Description

@nicolasstucki

Compiler version

3.0.1

Minimized example

import language.experimental.erasedDefinitions

erased class Capability

def f(using Capability): Int = 1
def g[C <: Capability](using C): Int = 1

Output

6 |def g[C <: Capability](using C): Int = 1
  |                             ^
  |illegal reference to erased trait Capability in definition that is not itself erased

Expectation

We should be able to abstract over erased classes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions