Skip to content

line number for GADT type error is very inaccurate

Here is an error message from 6.11:

cmm/ZDF5ex.hs:528:2:
    Couldn't match expected type `ZOpen'
           against inferred type `ZClosed'
      Expected type: ZipGF m l e x
      Inferred type: ZipGF m l C O
    In the first argument of `anal_f', namely `g'
    In the expression: anal_f g (return . fromZJust) ZNothing

This is all very well, but the offending term (the one shown in the message) is actually on line 697, not line 528. The term is part of one declaration in a monster 'where' clause attached to the definition on line 528, column 2. The next one might not be so easy to find.

I'm attaching the file, which is part of some new GHC code I'm hoping to deliver one of these months. If you need access to the whole thing I'll have a branch in a git repository.

Trac metadata
Trac field Value
Version 6.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information