-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
Milestone
Description
Unless I'm missing something, there is no safe way (i.e., without using an asInstanceOf) to go from two TypeTags with equal types (as computed by tag.tpe.=:=) to an instance of =:=. Is this actually unsafe? If not, would it make sense to have a way to do this in the standard library?
For reference, the unsafe way to write this is:
def fromTags[A, B](A: TypeTag[A], B: TypeTag[B]): Option[A =:= B] = {
if (A.tpe =:= B.tpe) Some(=:=.tpEquals[A].asInstanceOf[A =:= B])
else None
}Reactions are currently unavailable