How are Scala <:< and =:= operators used, and how does their Predef implementation work?

168 Views Asked by At

Possible Duplicate:
What do <:<, <%<, and =:= mean in Scala 2.8, and where are they documented?

Evidently <:< and =:= are used to assert that two types have a subclass relationship or are equal. But the documentation isn't clear how they're used, and searching for them is nearly impossible in Google given that they're composed entirely of symbols. (Yet one more reason why such symbol-goo names are a bad idea.)

Also, how does their implementation in Predef work? I was very surprised to find out that they aren't built-ins, since I didn't realize that Scala lets you create operators that act on types in this way -- which feature in Scala lets you do this? And the implementation in Predef is completely opaque. Is there some compiler magic going on here?

0

There are 0 best solutions below