Skip to content

Instantly share code, notes, and snippets.

@Locke
Last active November 3, 2016 21:52
Show Gist options
  • Save Locke/2c3c84ee3777ec584dd9793f2a8c2af9 to your computer and use it in GitHub Desktop.
Save Locke/2c3c84ee3777ec584dd9793f2a8c2af9 to your computer and use it in GitHub Desktop.
scala 2.12.0: Subtractable's type parameter bounds
$ sbt
> console
[info] Starting scala interpreter...
[info]
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.
scala> val nestedScala = Seq(Set("a", 1), Map(5 -> "x"))
nestedScala: Seq[scala.collection.immutable.Iterable[Any] with Int => Any{def seq: scala.collection.immutable.Iterable[Any] with Int => Any{def seq: scala.collection.immutable.Iterable[Any] with Int => Any}}] = List(Set(a, 1), Map(5 -> x))
> console
[info] Starting scala interpreter...
[info]
Welcome to Scala 2.12.0-M5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.
scala> val nestedScala = Seq(Set("a", 1), Map(5 -> "x"))
nestedScala: Seq[scala.collection.immutable.Iterable[Any] with Int => Any{def seq: scala.collection.immutable.Iterable[Any] with Int => Any{def seq: scala.collection.immutable.Iterable[Any] with Int => Any}}] = List(Set(a, 1), Map(5 -> x))
$ sbt
> console
[info] Starting scala interpreter...
[info]
Welcome to Scala 2.12.0-RC1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.
scala> val nestedScala = Seq(Set("a", 1), Map(5 -> "x"))
<console>:11: error: type arguments [?,Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any]]]{def seq: Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any]]}] do not conform to trait Subtractable's type parameter bounds [A,+Repr <: scala.collection.generic.Subtractable[A,Repr]]
val nestedScala = Seq(Set("a", 1), Map(5 -> "x"))
^
<console>:11: error: type arguments [?,Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any]]]{def seq: Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any]]}] do not conform to trait Subtractable's type parameter bounds [A,+Repr <: scala.collection.generic.Subtractable[A,Repr]]
val nestedScala = Seq(Set("a", 1), Map(5 -> "x"))
^
$ sbt
> console
[info] Starting scala interpreter...
[info]
Welcome to Scala 2.12.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.
scala> val nestedScala = Seq(Set("a", 1), Map(5 -> "x"))
<console>:11: error: type arguments [?,Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any]]]{def seq: Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any]]}] do not conform to trait Subtractable's type parameter bounds [A,+Repr <: scala.collection.generic.Subtractable[A,Repr]]
val nestedScala = Seq(Set("a", 1), Map(5 -> "x"))
^
<console>:11: error: type arguments [?,Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any]]]{def seq: Iterable[Any] with Int => Any with scala.collection.generic.Subtractable[_ >: Int, Iterable[Any]]}] do not conform to trait Subtractable's type parameter bounds [A,+Repr <: scala.collection.generic.Subtractable[A,Repr]]
val nestedScala = Seq(Set("a", 1), Map(5 -> "x"))
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment