Skip to content

Assertion error when passing an Expr[A] at a polymorphic method with Type evidence for A #4414

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
biboudis opened this issue Apr 29, 2018 · 0 comments

Comments

@biboudis
Copy link
Contributor

It is probably not an intended use if you require a type tag for an Expr using it in a single-stage manner but here is an exception I get with -Ycheck: all while typing the method b[quoted.Expr[A]].

import scala.quoted._

object Test {

  def a[A: Type](): Unit = {
    b[Expr[A]]()
    a[A]()
  }

  def b[A: Type](): Unit = ???
}

with the following assertion error:

assertion failed: found:    scala.quoted.Type[quoted.Expr[T$1]]
required: quoted.Type[quoted.Expr[A]]

The problem disappears if I do one of these (mechanically):

  • either remove a[A]() or
  • remove the Type evidence in b
  • or add a () return value in a
  • or change the order of the method calls a and b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants