X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FHeaderInfo.hs;h=b520098a283dc579a28119919f3ba211abcf40f6;hb=24a3fee9f3ff6cef6fe471ab6f0a7ba9ac001faf;hp=e16c2ce562b07e7b25acd3b274ad06cefe5165b5;hpb=4917397e279b0aa755eb09e1ca62913237132895;p=ghc-hetmet.git diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs index e16c2ce..b520098 100644 --- a/compiler/main/HeaderInfo.hs +++ b/compiler/main/HeaderInfo.hs @@ -264,7 +264,6 @@ checkExtension (L l ext) -- its corresponding flag. Otherwise it throws an exception. = let ext' = unpackFS ext in if ext' `elem` supportedLanguages - || ext' `elem` (map ("No"++) supportedLanguages) then L l ("-X"++ext') else unsupportedExtnError l ext' @@ -281,7 +280,9 @@ unsupportedExtnError :: SrcSpan -> String -> a unsupportedExtnError loc unsup = throw $ mkSrcErr $ unitBag $ mkPlainErrMsg loc $ - text "Unsupported extension: " <> text unsup + text "Unsupported extension: " <> text unsup $$ + if null suggestions then empty else text "Perhaps you meant" <+> quotedListWithOr (map text suggestions) + where suggestions = fuzzyMatch unsup supportedLanguages optionsErrorMsgs :: [String] -> [Located String] -> FilePath -> Messages