Skip to content

Reification of a type member selection doesn't account for existing type tags of the selector #7972

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

Open
scabug opened this issue Nov 14, 2013 · 2 comments
Milestone

Comments

@scabug
Copy link

scabug commented Nov 14, 2013

import scala.reflect.runtime.universe._

trait Foo {
  type Bar
}

object Test extends App {
  def foo[E <: Foo : TypeTag] = {
    val x = typeOf[E#Bar]
    println(x)
  }
}
19:03 ~/Projects/210x/sandbox (2.10.x)$ sli
Test.scala:9: materializing requested reflect.runtime.universe.type.TypeTag[E#Bar] using `package`.this.materializeTypeTag[E#Bar](scala.reflect.runtime.`package`.universe)
    val x = typeOf[E#Bar]
                  ^
Test.scala:9: materializing requested reflect.runtime.universe.type.TypeTag[E#Bar] using `package`.this.materializeTypeTag[E#Bar](scala.reflect.runtime.`package`.universe)
    val x = typeOf[E#Bar]
                  ^
Test.scala:9: `package`.this.materializeTypeTag[E#Bar](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[E#Bar] because:
failed to typecheck the materialized tag:
cannot create a TypeTag having unresolved type parameter E#Bar: use WeakTypeTag instead
    val x = typeOf[E#Bar]
                  ^
Test.scala:9: error: No TypeTag available for E#Bar
    val x = typeOf[E#Bar]
                  ^
one error found
@scabug
Copy link
Author

scabug commented Nov 14, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7972?orig=1
Reporter: @xeno-by
Affected Versions: 2.10.3

@scabug
Copy link
Author

scabug commented Nov 16, 2013

@paulp said:
You might want to look at #7278.

@SethTisue SethTisue added this to the Backlog milestone Mar 2, 2018
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

3 participants