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
set"..." ~= { ... }
I was trying to use goggles to modify a value inside a case class with a type parameter (type parameters should remain the same).
Simplified, code like this:
import goggles._ case class Boxed[+A](get: A) set"${Boxed(1)}.get" ~= { _ + 1 }
results in following error:
The types of consecutive sections don't match. found : Playground.this.Boxed[Int] required: Playground.this.Boxed[Int] Sections │ Types │ Optics ──────────┼──────────────────┼──────── $ │ Boxed[Int] │ .get │ Boxed[Int] ⇒ A │ Setter
while I would expect Boxed(2), it would be nice even if compile-time error was less misleading.
Boxed(2)
The text was updated successfully, but these errors were encountered:
Good catch, thanks for the report! It works if the case class doesn't have type parameters, so clearly it's choking on the generics.
scala> case class BoxI(get: Int) defined class BoxI scala> set"${BoxI(1)}.get" ~= { _ + 1 } res5: BoxI = BoxI(2)
Sorry, something went wrong.
No branches or pull requests
I was trying to use goggles to modify a value inside a case class with a type parameter (type parameters should remain the same).
Simplified, code like this:
results in following error:
while I would expect
Boxed(2)
, it would be nice even if compile-time error was less misleading.The text was updated successfully, but these errors were encountered: