Opened 4 years ago

Closed 3 years ago

#11213 closed bug (fixed)

Incorrect reported pattern synonym signature

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

Description (last modified by bgamari)

data T where
  MkT :: (Show b) => b -> T

--pattern ExNumPat :: () => Show b => b -> T
pattern ExNumPat x = MkT x

GHC reports that ExNumPat is missing a signature (correctly) but it reports the wrong type. The correct type is the one commented out.

pstest.hs:12:1: warning:
    Top-level binding with no type signature:
      ExNumPat :: forall b. Show b => b -> T

Change History (4)

comment:1 Changed 4 years ago by thomie

Component: CompilerCompiler (Type checker)

comment:2 Changed 4 years ago by rdragon

Differential Rev(s): Phab:D1896

comment:3 Changed 3 years ago by Matthew Pickering <matthewtpickering@…>

In 72bd7f7b/ghc:

Improve printing of pattern synonym types

Add the function `pprPatSynType :: PatSyn -> SDoc` for printing pattern
synonym types, and remove the ambiguous `patSynType` function. Also,
the types in a `PatSyn` are now tidy.

Haddock submodule updated to reflect the removal of `patSynType` by

Fixes: #11213.

Reviewers: goldfire, simonpj, austin, mpickering, bgamari

Reviewed By: simonpj, mpickering

Subscribers: bollmann, simonpj, thomie

Differential Revision:

GHC Trac Issues: #11213

comment:4 Changed 3 years ago by bgamari

Description: modified (diff)
Milestone: 8.0.1
Resolution: fixed
Status: newclosed

This was merged to ghc-8.0 as f75e098a0e3f7c81cad92e6b52f6c00a6491152d.

Note: See TracTickets for help on using tickets.