ApiAnnotations : mkGadtDecl discards annotations for HsFunTy

Authored by alanz.

Description

ApiAnnotations : mkGadtDecl discards annotations for HsFunTy

Summary:
When mkGadtDecl is presented wih a HsFunTy it discards the SrcSpan, thus
disconnecting any annotations on the HsFunTy.

mkGadtDecl names (L ls (HsForAllTy imp Nothing qvars cxt tau))
  = return $ mk_gadt_con names
  where
    (details, res_ty)           -- See Note [Sorting out the result type]
      = case tau of
          L _ (HsFunTy (L l (HsRecTy flds)) res_ty)
                                            -> (RecCon (L l flds), res_ty)
          _other                                    -> (PrefixCon [], tau)
...

This can be triggered by the following

{-# LANGUAGE GADTs #-}
module GADTRecords2 (H1(..)) where

-- | h1
data H1 a b where
  C3 :: (Num a) => { field :: a -- ^ hello docs
                   } -> H1 Int Int

Test Plan: ./validate

Reviewers: hvr, austin

Reviewed By: austin

Subscribers: bgamari, thomie, mpickering

Differential Revision: https://phabricator.haskell.org/D848

GHC Trac Issues: Trac #10309

(cherry picked from commit e4032b1951a35d8df63a74ebfee7449988b5ef40)

Details

Committed
alanzMay 11 2015, 4:12 PM
Reviewer
austin
Differential Revision
D848: ApiAnnotations : mkGadtDecl discards annotations for HsFunTy
This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Commit No Longer Exists

This commit no longer exists in the repository.