You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a literal is interpolated in an index position, the type is overspecialised to the exact literal instance type (Int(1), String("abc"), Char('a') etc), rather than the expected type (Int, String. Char).
I believe the problem lies in the code that parses the implicit monocle.function.Index[S,I,A] instance.
Example:
scala> val x = Map("a" -> 1, "b" -> 2, "c" -> 3)
x: scala.collection.immutable.Map[String,Int] = Map(a -> 1, b -> 2, c -> 3)
scala> get"$x[${"a"}]"
<console>:29: error: No implicit monocle.function.Index[scala.collection.immutable.Map[String,Int], String("a"), _] found to support '[]' indexing
scala> get"$x[${"a": String}]"
res27: Option[Int] = Some(1)
The text was updated successfully, but these errors were encountered:
When a literal is interpolated in an index position, the type is overspecialised to the exact literal instance type (
Int(1)
,String("abc")
,Char('a')
etc), rather than the expected type (Int
,String
.Char
).I believe the problem lies in the code that parses the implicit
monocle.function.Index[S,I,A]
instance.Example:
The text was updated successfully, but these errors were encountered: