Opened 3 years ago

Closed 3 years ago

#9084 closed bug (fixed)

Template Haskell should warn when it encounters an unencodable pragma

Reported by: goldfire Owned by: goldfire
Priority: normal Milestone:
Component: Template Haskell Version: 7.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: th/T9084
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D388
Wiki Page:


When I say this

{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wall #-}

module Bug where

   class C a where
     meth :: a -> a
     meth = undefined -- give a (silly) default
     {-# MINIMAL meth #-}

instance C Int

I get no warnings. I'm not surprised that TH doesn't handle every pragma that GHC knows about, but it should issue a (suppressable) warning when it discards one.

I can fix this one.

Change History (6)

comment:1 Changed 3 years ago by goldfire

Differential Rev(s): Phab:D388

comment:2 Changed 3 years ago by Richard Eisenberg <eir@…>

In 862772b7ecfce977ffe7090659da3bd923ef946a/ghc:

Test #9084 in th/T9084.

The patch includes errors for a whole host of pragmas. But, these
are generated one at a time, and it doesn't seem like a good idea
to add gobs of test-cases here.

comment:3 Changed 3 years ago by Richard Eisenberg <eir@…>

In 03d61cce4d92a37a193cc1211eb7262149f22e3b/ghc:

Fix #9084 by calling notHandled when unknown bits are enountered.

comment:4 Changed 3 years ago by Richard Eisenberg <eir@…>

In 17265c033707a84fd59fec61b3a370c3a427ffa3/ghc:

Fix testsuite output from #9084.

comment:5 Changed 3 years ago by Richard Eisenberg <eir@…>

In 18a4a5dad3cbee3c8bb4005ec09edf401ebe294c/ghc:

Update release notes for #9262 #8953 #9084.

comment:6 Changed 3 years ago by goldfire

Resolution: fixed
Status: newclosed
Test Case: th/T9084
Note: See TracTickets for help on using tickets.