#15123 closed task (fixed)

mg_arg_tys in MatchGroup should be a PostTc field

Reported by: mpickering Owned by:
Priority: normal Milestone: 8.6.1
Component: Compiler Version: 8.2.2
Keywords: newcomer Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


It appears that mg_arg_tys is only populated after typechecking but the type does not indicate this.

Instead of

mg_arg_tys :: [PostTc p Type]

the type should be

mg_arg_tys :: PostTc p [Type]

All that needs doing is modifying this type in compiler/HsSyn/HsExpr.hs and then fixing the resulting compiler errors.

Change History (1)

comment:1 Changed 17 months ago by RyanGlScott

Resolution: fixed
Status: newclosed

This was done in c3823cba2147c74b2c727b5458b9e95350496988. The definition of MatchGroup is now:

data MatchGroup p body
  = MG { mg_ext     :: XMG p body
       , mg_alts    :: Located [LMatch p body]
       , mg_origin  :: Origin }
  | XMatchGroup (XXMatchGroup p body)

data MatchGroupTc
  = MatchGroupTc
       { mg_arg_tys :: [Type]
       , mg_res_ty  :: Type
       } deriving Data

type instance XMG         GhcPs b = NoExt
type instance XMG         GhcRn b = NoExt
type instance XMG         GhcTc b = MatchGroupTc

In particular, the extension point is no longer awkwardly nested underneath the [] type constructor.

Note: See TracTickets for help on using tickets.