Opened 3 years ago

Closed 3 years ago

#12064 closed bug (fixed)

tcIfaceGlobal error with existentially quantified types

Reported by: ezyang Owned by: ezyang
Priority: normal Milestone: 8.0.2
Component: Compiler (Type checker) Version: 8.0.1
Keywords: hs-boot Cc: simonpj
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D2221
Wiki Page:

Description (last modified by ezyang)

Consider the following program:

-- A.hs-boot
module A where
data D

-- B.hs
module B where
import {-# SOURCE #-} A
class K a where
  method :: D -> a

-- A.hs
{-# LANGUAGE ExistentialQuantification #-}
module A where
import B
data D = forall n. K n => D

We get a tcIfaceGlobal error in this case (one-shot of course.) I reduced this case out of prog006.

So for some reason we're tugging on K too early—that's as far as I know at this point.

Change History (7)

comment:1 Changed 3 years ago by ezyang

Owner: set to ezyang

comment:2 Changed 3 years ago by ezyang

Description: modified (diff)

comment:3 Changed 3 years ago by ezyang

Differential Rev(s): Phab:D2221
Status: newpatch

comment:4 Changed 3 years ago by simonpj

Land it!

comment:5 Changed 3 years ago by Edward Z. Yang <ezyang@…>

In 8f6d292/ghc:

Fix #12064 by making IfaceClass typechecking more lazy.

Comes with a test based off of prog006.

Signed-off-by: Edward Z. Yang <>

Test Plan: validate

Reviewers: simonpj, austin, bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #12064

comment:6 Changed 3 years ago by ezyang

Status: patchmerge

comment:7 Changed 3 years ago by bgamari

Milestone: 8.0.2
Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.