Skip to content
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

Specialization + dependent method type --> inconsistent symbols #12210

Closed
adriaanm opened this issue Oct 25, 2016 · 1 comment · Fixed by scala/scala#9652
Closed

Specialization + dependent method type --> inconsistent symbols #12210

adriaanm opened this issue Oct 25, 2016 · 1 comment · Fixed by scala/scala#9652
Assignees
Milestone

Comments

@adriaanm
Copy link
Contributor

trait SpecFun[@specialized T] {
  type Res
  def res: Res
}

object Test {
  // the symbols for the `op` argument get out of synch
  def m[@specialized T](op: SpecFun[T]): op.Res = op.res
}
@dwijnand dwijnand transferred this issue from scala/scala-dev Oct 26, 2020
@dwijnand dwijnand added this to the Backlog milestone Oct 26, 2020
@dlwh
Copy link

dlwh commented May 3, 2021

this might be an instance of the same bug, but though I'd leave it here:

trait ValuesVisitor[A] {
  def visit(a: A): Unit

  def visitArray(arr: Array[A]): Unit = ???
}

class OpArray[@specialized A] {
  def traverse(from: Array[A], fn: ValuesVisitor[A]): fn.type = {
    fn.visitArray(from)
    fn
  }

}
traverse.scala:11: error: type mismatch;
 found   : fn.type (with underlying type ValuesVisitor[Byte])
 required: fn.type
    fn
    ^

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.

5 participants