Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type arguments do not conform to trait Subtractable's type parameter bounds #10359

Closed
Proximator opened this issue Jun 6, 2017 · 2 comments
Closed

Comments

@Proximator
Copy link

Proximator commented Jun 6, 2017

After upgrading to Scala 2.12, I am having a weird compilation issue of this code:

val c = Map("a" -> Set[Map[String, String]](), "b" -> Map[String, String]())

It is throwing this exception:
Error:(19, 7) type arguments [?,Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any with scala.collection.generic.Subtractable[_ >: String with scala.collection.immutable.Map[String,String] <: Object, Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any with scala.collection.generic.Subtractable[_ >: String with scala.collection.immutable.Map[String,String] <: Object, Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any with scala.collection.generic.Subtractable[_ >: String with scala.collection.immutable.Map[String,String] <: Object, Equals]]{def seq: Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any with scala.collection.generic.Subtractable[_ >: String with scala.collection.immutable.Map[String,String] <: Object, Equals]}]{def seq: Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any with scala.collection.generic.Subtractable[_ >: String with scala.collection.immutable.Map[String,String] <: Object, Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any with scala.collection.generic.Subtractable[_ >: String with scala.collection.immutable.Map[String,String] <: Object, Equals]]{def seq: Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any with scala.collection.generic.Subtractable[_ >: String with scala.collection.immutable.Map[String,String] <: Object, Equals]}}] do not conform to trait Subtractable's type parameter bounds [A,+Repr <: scala.collection.generic.Subtractable[A,Repr]]

@som-snytt
Copy link

Probably #10151

@SethTisue
Copy link
Member

note that even in 2.11 a rather outlandish type is inferred:

Welcome to Scala 2.11.12 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_162).

scala> val c = Map("a" -> Set[Map[String, String]](), "b" -> Map[String, String]())
c: scala.collection.immutable.Map[String,scala.collection.immutable.Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any{def seq: scala.collection.immutable.Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any{def seq: scala.collection.immutable.Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any{def seq: scala.collection.immutable.Iterable[Equals] with String with scala.collection.immutable.Map[String,String] => Any}}}] = Map(a -> Set(), b -> Map())

let's consolidate under #10151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants