Skip to content

Deriving equalities from inequalities produces a misleading error message #85

@kleinreact

Description

@kleinreact

For the following example

leZeroToEqZero :: n <= 0 => (n ~ 0 => r) -> r
leZeroToEqZero x = x

GHC reports that

• Could not deduce 'n ~ 0' arising from a use of 'x'
   from the context: n <= 0

which makes it perfectly clear that GHC can't derive the equality constraint from the inequality constraint here. However, enabling the plugin turns that into

Cannot satisfy: n <= 0

which is misleading, as n <= 0 is a given constraint. Furthermore, it does not make clear that the plugin won't be able to derive the equality either (see #33).

This error message probably also caused some confusion with respect to fixes proposed by @rowanG077 in #83.

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