Skip to content

No "warning: [-Wunrecognised-pragmas] Unrecognised pragma" when there is no name of pragmas

module Qwer where

a = ({-# LANGUAGE #-})

main :: IO ()
main = print (if True then () else ())

if a = ({-# #-}) then GHC compiles with a warning\\

qwer.hs:3:6: warning: [-Wunrecognised-pragmas] Unrecognised pragma
  |
3 | a = ({-# #-})
  |      ^^^
Ok, modules loaded: Qwer.

if you write a = ({-# LANGUAGE #-}) without writing the name GHC compiles the file without specifying a warning.\\

*Qwer> :l qwer.hs
[1 of 1] Compiling Qwer             ( qwer.hs, interpreted )
Ok, modules loaded: Qwer.

GHCi, version 8.2.0.20170507

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information