They refer to the same thing, yet when I compare 2 type tags:
val ttg1 = typeTag[Map[_,_]]
val ttg2 = typeTag[immutable.Map[_,_]]
assert(ttg1.tpe == ttg2.tpe)
I got:
Map[_, _] did not equal scala.collection.immutable.Map[_,_]
ScalaTestFailureLocation:
Expected :scala.collection.immutable.Map[_,_]
Actual :Map[_, _]
How could this happen in a typed language? How do I make them identical?
UPDATE: for List this is more confusing:
val ttg1 = typeTag[List[_]]
val ttg2 = typeTag[immutable.List[_]]
assert(ttg1.tpe == ttg2.tpe)
List[_] did not equal List[_]
ScalaTestFailureLocation:
Expected :List[_]
Actual :List[_]
They are exactly the same thing! Yet reflection choose to ignore it.