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

PSubset.subType is unsound #4

Open
Odomontois opened this issue Jun 19, 2020 · 0 comments
Open

PSubset.subType is unsound #4

Odomontois opened this issue Jun 19, 2020 · 0 comments

Comments

@Odomontois
Copy link
Member

https://scastie.scala-lang.org/Odomontois/V9g3cTrsTui4xpc3qhp0wA

import tofu.optics._
val s = Subset[List[String], List[Nothing]]
val x : List[Int] = s.getOption(List("sound", "of", "silence")).toList.flatten
x.sum

produces "Class cast exception`

Monocle macro has the same problem

https://scastie.scala-lang.org/Odomontois/V9g3cTrsTui4xpc3qhp0wA/2

We need to come with some more wise method to write that macro.

@danslapman danslapman transferred this issue from tofu-tf/tofu Aug 19, 2022
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

1 participant