We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I've noticed if I try to create a Map with the key as a Refined Type and instantiate it with a literal, the compiler gives an error:
import eu.timepit.refined.auto._ import eu.timepit.refined.types.all.NonEmptyString val bar: Map[NonEmptyString, NonEmptyString] = Map("1" -> "foobar") /* found : (String, String) required: (eu.timepit.refined.types.all.NonEmptyString, eu.timepit.refined.types.all.NonEmptyString) */
I can change to just the value as a Refined type and it works as expected:
import eu.timepit.refined.auto._ import eu.timepit.refined.types.all.NonEmptyString val bar: Map[String, NonEmptyString] = Map("1" -> "foobar") // val bar: Map[String,eu.timepit.refined.types.all.NonEmptyString] = Map(1 -> foobar)
I can also create a Map out Tuples which works:
import eu.timepit.refined.auto._ import eu.timepit.refined.types.all.NonEmptyString val bar: Map[NonEmptyString, NonEmptyString] = Map(("1", "foobar")) // val bar: Map[eu.timepit.refined.types.all.NonEmptyString,eu.timepit.refined.types.all.NonEmptyString] = Map(1 -> foobar)
So it looks like the Arrow syntax is causing this - is this intended behaviour?
The text was updated successfully, but these errors were encountered:
Not intended but expected at least. The arrow syntax is an implicit conversion and the automatic refinement is an implicit conversion but Scala won't chain them so that your first snippet typechecks.
Sorry, something went wrong.
No branches or pull requests
Hi, I've noticed if I try to create a Map with the key as a Refined Type and instantiate it with a literal, the compiler gives an error:
I can change to just the value as a Refined type and it works as expected:
I can also create a Map out Tuples which works:
So it looks like the Arrow syntax is causing this - is this intended behaviour?
The text was updated successfully, but these errors were encountered: