Skip to content

Invalid location reported for type constructors

Given

module Example where

data T = MkT

The locations as reported in 7.4 and 7.7 are different:

  • In 7.4 the ADT is represented as a TyData, itself part of an HsGroup. The TyData contains a Located Name; the location of this name is reported correctly as 3:6. The SrcSpan associated with the Name itself (which represents the def site) is also reported as 3:6, which is dubious.
  • In 7.8 the ADT is represented as a DataDecl (part of TyClGroup inside a HsGroup). As before, the DataDeclcontains a Located Name; the location now however is 3:1-12, which doesn't make sense. The def site associated with the name itself is also 3:1-12, which does make sense.

It seems that when the def site was fixed, it also changed the location of the identifier itself. These two are separate.

Trac metadata
Trac field Value
Version 7.7
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