Ticket #5955 (closed bug: fixed)

Opened 14 months ago

Last modified 14 months ago

Renamer hangs when checking type family consistency

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

Description

checkFamInstConsistency goes into and endless loop in some situations when called from tcRnImports. I have attached a tarball containing a boiled-down example consisting of three .hs files and a shell script. The hang only happens when compiling the three files (in dependency order) manually with -c; the hang does not happen with --make. So it looks like importing a module is not loading something that checkFamInstConsistency is assuming is there.

Attachments

bug.tar.gz Download (0.7 KB) - added by gmainland 14 months ago.
Test case exhibiting the bug

Change History

Changed 14 months ago by gmainland

Test case exhibiting the bug

Changed 14 months ago by gmainland

  • version changed from 7.4.1 to 7.5

This is with revision 69570789166052c90a335dadbfaa8cfc1ad84330 (HEAD as of the time of the bug report).

Changed 14 months ago by simonpj

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

Fixed by

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Wed Mar 28 09:56:14 2012 +0100

    Add a crucial forkM on the superclass context of IfaceClass in tcIfaceDecl
    
    The absence of this was causing a loop when typechecking an interface
    where the superclass context mentioned an associated type
       class C (T a) => D a where
         data T a
    
    Fixes Trac #5970

 compiler/iface/BuildTyCl.lhs   |    7 +++----
 compiler/iface/LoadIface.lhs   |    2 +-
 compiler/iface/TcIface.lhs     |   36 +++++++++++++++++++++++++-----------
 compiler/typecheck/FamInst.lhs |    3 +++
 4 files changed, 32 insertions(+), 16 deletions(-)

The comment is wrong when it mentions #5970; the patch fixes this ticket #5955.

Note: See TracTickets for help on using tickets.