Skip to content

Support extension methods on erased types #11743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nicolasstucki opened this issue Mar 15, 2021 · 0 comments · Fixed by #11695
Closed

Support extension methods on erased types #11743

nicolasstucki opened this issue Mar 15, 2021 · 0 comments · Fixed by #11695

Comments

@nicolasstucki
Copy link
Contributor

Compiler version

3.0.0-RC1

Minimized example

//  import language.experimental.erasedTerms
import scala.compiletime.erasedValue
type UnivEq[A]
object UnivEq:
  erased def force[A]: UnivEq[A] = erasedValue
  extension [A](erased proof: UnivEq[A])
    inline def univEq(a: A, b: A): Boolean =
      a == b

With -Yerased-terms or the commented line (after #11695) is merged.

Output

-- [E040] Syntax Error: Foo.scala:6:16 -----------------------------------------
6 |  extension [A](erased proof: UnivEq[A])
  |                ^^^^^^
  |                an identifier expected, but 'erased' found

Expectation

It should compile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants