Rob N
Rob N

Reputation: 16399

Scala reflection - why TypeTag and Type?

These two types/classes in the Scala reflection API seem to represent the same thing. Why are they two separate types?

scala.reflect.api.Universe.Type
scala.reflect.api.Universe.TypeTag

Link to scala docs: scala.reflect.api.Universe

Upvotes: 1

Views: 175

Answers (1)

Eugene Burmako
Eugene Burmako

Reputation: 13048

Type is a reflection artifact bound to a particular universe. TypeTag is a type factory, capable of instantiating a type in any universe.

Upvotes: 7

Related Questions