Skip to content

Make -XTemplateHaskell an error in a stage-1 compiler

If you use the language extension -XTemplateHaskell in a stage-1 compiler, it's guaranteed not to work. This patch makes it an error to do so.

The error is suppressed in MkDepend mode (i.e. ghc -M) because that does work; the TH flag is not consulted.

Moreover it is used by GHC's build system itself: for some reason we use the stage-1 compiler to do build the .depend files for DPH, even though DPH is only built with stage2. This is an infelicity, but Ian writes "It's due to the build system phases: stage2 doesn't exist during the phase in which DPH is configured. Changing it to use stage 2 would probably mean adding another phase for things that need to be configured by stage 2. This might mean slower builds due to loss of parallelism, I'm not sure.

This change isn't mission critical; it could be a warning instead.

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