[GHC] #13332: Report unrecognized pragmas earlier

GHC ghc-devs at haskell.org
Fri Feb 24 05:37:12 UTC 2017


#13332: Report unrecognized pragmas earlier
-------------------------------------+-------------------------------------
           Reporter:  crockeea       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Poor/confusing
  Unknown/Multiple                   |  error message
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 In the following example, I have a typo in the `UndecidableInstances`
 pragma (`LANGUAGE` is misspelled), however, GHC ''only'' reports that
 `UndecidableInstances` is required. This is very confusing, since it
 appears that I have enabled that pragma.

 {{{
 {-# LANGUAGE FlexibleContexts     #-}
 {-# LANGUAGE FlexibleInstances    #-}
 {-# LANUGAGE UndecidableInstances #-}

 instance (Num [a]) => Num a
 }}}

 Only when I comment out the instance does GHC report that there is an
 unrecognized pragma, at which point it became obvious that there was a
 typo. It would be very helpful if GHC reported the warning about the
 unrecognized pragma before or at the same time as the error about needing
 `UndecidableInstances`.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13332>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list