Skip to content

Instantly share code, notes, and snippets.

@gruggiero
Created November 4, 2016 15:49
Show Gist options
  • Save gruggiero/1269b189d47d3f9e21b56cbf6e37107c to your computer and use it in GitHub Desktop.
Save gruggiero/1269b189d47d3f9e21b56cbf6e37107c to your computer and use it in GitHub Desktop.
Typeable Implicit not found
// Project A has several dependencies, including shapeless_2.10-2.2.5.jar
Welcome to Scala version 2.10.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_66).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import shapeless.syntax.typeable._
import shapeless.syntax.typeable._
import shapeless.syntax.typeable._
scala>
scala> (Set("foo", "bar", "baz"): Any).cast[Set[String]]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
<console>:11: shapeless.this.Typeable.genMapTypeable is not a valid implicit value for shapeless.Typeable[Set[String]] because:
hasMatchingSymbol reported error: polymorphic expression cannot be instantiated to expected type;
found : [M[X, Y], K, V]shapeless.Typeable[M[K,V]]
required: shapeless.Typeable[Set[String]]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: materializing requested scala.reflect.type.ClassTag[Set[_]] using `package`.this.materializeClassTag[Set[_]]()
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: shapeless.this.Typeable.genMapTypeable is not a valid implicit value for shapeless.Typeable[String] because:
hasMatchingSymbol reported error: polymorphic expression cannot be instantiated to expected type;
found : [M[X, Y], K, V]shapeless.Typeable[M[K,V]]
required: shapeless.Typeable[String]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: shapeless.this.Typeable.genTraversableTypeable is not a valid implicit value for shapeless.Typeable[String] because:
hasMatchingSymbol reported error: polymorphic expression cannot be instantiated to expected type;
found : [CC[X] <: scala.collection.GenTraversable[X], T]shapeless.Typeable[CC[T]]
required: shapeless.Typeable[String]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
res0: Option[Set[String]] = Some(Set(foo, bar, baz))
scala>
// Project B depends on Project A and others projects
Welcome to Scala version 2.10.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_66).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import shapeless.syntax.typeable._
import shapeless.syntax.typeable._
import shapeless.syntax.typeable._
scala>
scala> (Set("foo", "bar", "baz"): Any).cast[Set[String]]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
<console>:11: shapeless.this.Typeable.genMapTypeable is not a valid implicit value for shapeless.Typeable[Set[String]] because:
hasMatchingSymbol reported error: polymorphic expression cannot be instantiated to expected type;
found : [M[X, Y], K, V]shapeless.Typeable[M[K,V]]
required: shapeless.Typeable[Set[String]]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: materializing requested scala.reflect.type.ClassTag[Set[_]] using `package`.this.materializeClassTag[Set[_]]()
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: shapeless.this.Typeable.genMapTypeable is not a valid implicit value for shapeless.Typeable[String] because:
hasMatchingSymbol reported error: polymorphic expression cannot be instantiated to expected type;
found : [M[X, Y], K, V]shapeless.Typeable[M[K,V]]
required: shapeless.Typeable[String]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: shapeless.this.Typeable.genTraversableTypeable is not a valid implicit value for shapeless.Typeable[String] because:
hasMatchingSymbol reported error: polymorphic expression cannot be instantiated to expected type;
found : [CC[X] <: scala.collection.GenTraversable[X], T]shapeless.Typeable[CC[T]]
required: shapeless.Typeable[String]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: shapeless.this.Lazy.apply is not a valid implicit value for (=> shapeless.Lazy[shapeless.Typeable[String]]) => shapeless.Lazy[Nothing] because:
type mismatch;
found : shapeless.Lazy[shapeless.Typeable[String]]
required: Nothing
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: shapeless.this.Lazy.mkLazy is not a valid implicit value for shapeless.Lazy[shapeless.Typeable[String]] because:
hasMatchingSymbol reported error: type mismatch;
found : shapeless.Lazy[shapeless.Typeable[String]]
required: shapeless.Lazy[Nothing]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: shapeless.this.Typeable.genTraversableTypeable is not a valid implicit value for shapeless.Typeable[Set[String]] because:
hasMatchingSymbol reported error: could not find implicit value for parameter castT: shapeless.Lazy[shapeless.Typeable[String]]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: shapeless.this.Typeable.dfltTypeable is not a valid implicit value for shapeless.Typeable[Set[String]] because:
No default Typeable for parametrized type Set[String]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
<console>:11: error: could not find implicit value for parameter castU: shapeless.Typeable[Set[String]]
(Set("foo", "bar", "baz"): Any).cast[Set[String]]
^
scala>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment