Example of how disjunction can be used:
Example of how disjunction can be used:
scala> import com.datastax.spark.connector.util.MagicalTypeTricks._ import com.datastax.spark.connector.util.MagicalTypeTricks._ scala> def function[T](t: T)(implicit ev: (ᅫᄏ[T] <:< (Int ¬ネᆰ String))) = { println(s"t = $t") } function: [T](t: T)(implicit ev: <:<[(T => Nothing) => Nothing,Int => Nothing with String => Nothing => Nothing])Unit scala> function(5) t = 5 scala> function("five") t = five scala> function(5d) <console>:13: error: Cannot prove that (Double => Nothing) => Nothing <:< Int => Nothing with String => Nothing => Nothing. function(5d) ^
Based on this article.