Skip to content

PSubset.subType is unsound #4

@Odomontois

Description

@Odomontois

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions