Skip to content

Make unknown LANGUAGE pragmas a warning, not an error

Currently, if I say {-# LANGUAGE Foo #-} at the top of my file, it fails to compile. This failure seems unnecessary, especially because any new language feature Foo enables will fail to compile later on down the file. Is it possible to have a "stern warning" that is produced even when other parts of the file produce errors?

The reason I'm bringing this up is that, when 7.8 came out with its role annotations, users needed CPP in two different places: both to protect the RoleAnnotations pragma and to protect the role annotations themselves. This may be unavoidable on the role annotations directly, but I think we can improve the situation around LANGUAGE pragmas.

Is there a downside to this?

Trac metadata
Trac field Value
Version 7.8.2
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