Ticket #4200 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

UndecidableInstances not needed for equality constraints

Reported by: simonpj Owned by:
Priority: normal Milestone: 7.0.1
Component: Compiler Version: 6.12.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: indexed-types/should_compile/T4200 Blocked By:
Blocking: Related Tickets:

Description

Consider

instance (Op c, In c ~ Int) => Op (D2 c) where ...

Without -XUndecidableInstaces we get

undec.hs:21:0:
     Constraint is no smaller than the instance head
       in the constraint: In c ~ Int
     (Use -XUndecidableInstances to permit this)

But the undecidable-instance check is only needed for class constraints I think, so GHC is being over conservative. Let's fix this.

Change History

Changed 3 years ago by igloo

  • milestone set to 6.14.1

Changed 3 years ago by simonpj

  • status changed from new to closed
  • testcase set to indexed-types/should_compile/T4200
  • resolution set to fixed

Fixed by

Sun Sep 19 17:26:23 GMT Daylight Time 2010  simonpj@microsoft.com
  * Loosen the conditions for -XUndecidableInstances; fixes Trac #4200

    M ./compiler/typecheck/TcMType.lhs -8 +6
Note: See TracTickets for help on using tickets.