Skip to content

better unification for compound types #5550

Open
@scabug

Description

@scabug

See bug #1 in the context of this mailing list post:

http://groups.google.com/group/shapeless-dev/browse_thread/thread/1f26830027f3517

"1. It will not choose the correct implicit function for any type after
the first type in the destination disjunction."

The link below is an improved implementation that has the same bug, is less complex to follow, and thus if I am correct probably demonstrates that the problem is not peculiar to a simulated union type and rather general to implicits and compound type leaf nodes (i.e. those after the first with, e.g. the D[String] in D[D[Int] with D[String]]), when the implicit matching is in the contravariant direction. The neg implicit is chosen for D[D[Int]] but not for D[D[String]].

http://groups.google.com/group/shapeless-dev/browse_thread/thread/01f26830027f3517/7c1006ac6e638044?#7c1006ac6e638044

P.S. There is a duplicate syntax-highlighted version buried nearer to the bottom of the following stackoverflow answer:

http://stackoverflow.com/questions/3508077/does-scala-have-type-disjunction-union-types/7460312#7460312

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions