Skip to content

Spurious erased-given-is-used error #11896

Closed
@japgolly

Description

@japgolly

Compiler version

3.0.0-RC2-bin-20210325-eeb8340-NIGHTLY

Minimized code

sealed trait X[A]
object X {
  erased given unit: X[Unit] = compiletime.erasedValue
}

def x[A](f: List[A])(using erased X[A]): Int =
  123

def y(f: List[Unit]): Int =
  x(f)

Output

[error] 12 |  x(f)
[error]    |      ^
[error]    |      getter unit is declared as erased, but is in fact used

Expectation

It should compile.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions