You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
unchecked TypeRef match in interpreter/TypeStrings #6338
The following warning is generated during compilation of scalac (locker and quick):
src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala:215:warning: abstracttypereflect.runtime.universe.TypeRef in typepattern reflect.runtime.universe.TypeRef is unchecked since it is eliminated by erasure
deftypeArguments:List[ru.Type] = ru.typeOf[T] match { case ru.TypeRef(_, _, args) => args; case _ =>Nil }
^
It is likely a valid warning that results from ru.TypeRefTag not being visible for the pattern match. It should be straightforward to fix this particular warning, but in general, this is a problem with selective imports from Universe in reflection. I remember this general problem being discussed elsewhere (and Eugene wanting to be able to have XXTag imported whenever XX is imported), but I couldn't find an internals thread or bug report to link to.
@paulp said:
Apparently this will be the world's most exciting trivial fix, because attempting to include it with two of my pull requests caused both to fail. You can suppress the warning with import ru._, and then the rangepos test blows up on an unpositioned tree. https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/582/console
@adriaanm said:
(Pushing reflection bugs to 2.11 to aid scheduling -- as it's experimental in 2.10.x, it shouldn't influence 2.10's schedule. They may be fixed earlier, of course.)
Activity
scabug commentedon Sep 7, 2012
Imported From: https://issues.scala-lang.org/browse/SI-6338?orig=1
Reporter: @harrah
Affected Versions: 2.10.0-RC3
scabug commentedon Sep 7, 2012
@paulp said:
I'm not really working on 2.10 anymore, but if anyone wants it, this warning and other issues are handled here: https://github.com/paulp/scala/tree/topic/210-quieter-warnings
scabug commentedon Sep 7, 2012
@harrah said:
This warning is the valid one. The spurious warning is #6275. I've copied the comment there.
scabug commentedon Sep 7, 2012
@paulp said:
Pretty sure this warning is eliminated in that patch (by importing ru._.)
scabug commentedon Sep 7, 2012
@paulp said:
... and I haven't fixed 6275 yet.
scabug commentedon Sep 7, 2012
@harrah said:
I see. Sorry about that.
scabug commentedon Sep 7, 2012
@paulp said:
That's okay, it's refreshing to see you blunder once in a while.
scabug commentedon Sep 25, 2012
@paulp said:
Apparently this will be the world's most exciting trivial fix, because attempting to include it with two of my pull requests caused both to fail. You can suppress the warning with import ru._, and then the rangepos test blows up on an unpositioned tree. https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/582/console
scabug commentedon Dec 2, 2012
@xeno-by said:
#6754
scabug commentedon Dec 13, 2012
@adriaanm said:
(Pushing reflection bugs to 2.11 to aid scheduling -- as it's experimental in 2.10.x, it shouldn't influence 2.10's schedule. They may be fixed earlier, of course.)
scabug commentedon Nov 21, 2013
@retronym said:
Appears we forgot to close this for 2.10.1