Commit 102151c8 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Fake support for NamedFieldPuns in ghc-6.8

Implement it in terms of the -XRecordPuns which was accidentally
added in ghc-6.8 and deprecates in 6.10 in favor of NamedFieldPuns
So this is for compatability so we can tell package authors always
to use NamedFieldPuns instead.
parent 3a821f0f
......@@ -268,14 +268,23 @@ getLanguageExtensions verbosity ghcProg
case ext of
UnknownExtension _ -> simpleParse str
_ -> return ext
return [ (ext, "-X" ++ display ext)
| Just ext <- map readExtension (lines exts) ]
return $ extensionHacks
++ [ (ext, "-X" ++ display ext)
| Just ext <- map readExtension (lines exts) ]
| otherwise = return oldLanguageExtensions
where
Just ghcVersion = programVersion ghcProg
-- ghc-6.8 intorduced RecordPuns however it should have been
-- NamedFieldPuns. We now encourage packages to use NamedFieldPuns so for
-- compatability we fake support for it in ghc-6.8 by making it an alias
-- for the old RecordPuns extension.
extensionHacks = [ (NamedFieldPuns, "-XRecordPuns")
| ghcVersion >= Version [6,8] []
&& ghcVersion < Version [6,10] [] ]
-- | For GHC 6.6.x and earlier, the mapping from supported extensions to flags
oldLanguageExtensions :: [(Extension, Flag)]
oldLanguageExtensions =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment