#8821 closed bug (invalid)

Functional dependency coverage check does not use type equalities

Reported by: glguy Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 7.6.3
Keywords: Cc: iavor.diatchki@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

When checking the coverage condition to validate an instance, we should also consider equality constraints because they have a dependency in both directions.

class C a b | a -> b
instance (a ~ b) => C a b

--  Illegal instance declaration for ‛C a b’
--    The coverage condition fails in class ‛C’
--      for functional dependency: ‛a -> b’
--    Reason: lhs type ‛a’ does not determine rhs type ‛b’
--    Using UndecidableInstances might help
--  In the instance declaration for ‛C a b’

Change History (1)

comment:1 Changed 13 months ago by glguy

  • Resolution set to invalid
  • Status changed from new to closed

Iavor explained that Undecidable Instances is allowing the functional dependency to consider the context and that the test is working.

Note: See TracTickets for help on using tickets.