diff options
author | Soham Chowdhury <evertedsphere@gmail.com> | 2023-04-24 20:14:33 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-04-25 00:15:22 -0400 |
commit | 0da9e88273a0ffb13132631fb5ea526ea9efeeb9 (patch) | |
tree | 1c4414e9a2dfec8c514cf3f81cfda266f2cd778c | |
parent | 1a10f55657a4fc0391a726646552171d5bc7798f (diff) | |
download | haskell-0da9e88273a0ffb13132631fb5ea526ea9efeeb9.tar.gz |
More informative errors for bad imports (#21826)
57 files changed, 474 insertions, 237 deletions
diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs index aae3fe497b..92cab86d05 100644 --- a/compiler/GHC/Rename/Names.hs +++ b/compiler/GHC/Rename/Names.hs @@ -1241,7 +1241,7 @@ filterImports hsc_env iface decl_spec (Just (want_hiding, L l import_items)) | isQual rdr = failLookupWith (QualImportError rdr) | null lookups - = failLookupWith (BadImport ie) + = failLookupWith (BadImport ie BadImportIsParent) | otherwise = return $ concatMap nonDetNameEnvElts lookups where @@ -1249,8 +1249,8 @@ filterImports hsc_env iface decl_spec (Just (want_hiding, L l import_items)) lookup_lie :: LIE GhcPs -> TcRn [(LIE GhcRn, [GlobalRdrElt])] lookup_lie (L loc ieRdr) - = do (stuff, warns) <- setSrcSpanA loc $ - liftM (fromMaybe ([],[])) $ + = setSrcSpanA loc $ + do (stuff, warns) <- liftM (fromMaybe ([],[])) $ run_lookup (lookup_ie ieRdr) mapM_ emit_warning warns return [ (L loc ie, gres) | (ie,gres) <- stuff ] @@ -1261,21 +1261,20 @@ filterImports hsc_env iface decl_spec (Just (want_hiding, L l import_items)) emit_warning MissingImportList = whenWOptM Opt_WarnMissingImportList $ addTcRnDiagnostic (TcRnMissingImportList ieRdr) emit_warning (BadImportW ie) = whenWOptM Opt_WarnDodgyImports $ do - let msg = mkTcRnUnknownMessage $ - mkPlainDiagnostic (WarningWithFlag Opt_WarnDodgyImports) - noHints - (lookup_err_msg (BadImport ie)) - addDiagnostic msg + -- 'BadImportW' is only constructed below in 'handle_bad_import', in + -- the 'EverythingBut' case, so that's what we pass to + -- 'badImportItemErr'. + badImportItemErr iface decl_spec ie BadImportIsParent all_avails EverythingBut run_lookup :: IELookupM a -> TcRn (Maybe a) run_lookup m = case m of Failed err -> do - addErr $ mkTcRnUnknownMessage $ mkPlainError noHints (lookup_err_msg err) + lookup_err_msg err return Nothing Succeeded a -> return (Just a) lookup_err_msg err = case err of - BadImport ie -> badImportItemErr iface decl_spec ie all_avails + BadImport ie sub -> badImportItemErr iface decl_spec ie sub all_avails Exactly IllegalImport -> illegalImportItemErr QualImportError rdr -> qualImportItemErr rdr AmbiguousImport rdr xs -> ambiguousImportItemErr rdr xs @@ -1330,7 +1329,7 @@ filterImports hsc_env iface decl_spec (Just (want_hiding, L l import_items)) dc_name = lookup_name ie (setRdrNameSpace tc srcDataName) in case catIELookupM [ tc_name, dc_name ] of - [] -> failLookupWith (BadImport ie) + [] -> failLookupWith (BadImport ie BadImportIsParent) names -> return ([mkIEThingAbs tc' l (imp_item name) | name <- names], []) | otherwise -> do ImpOccItem { imp_item = gre } <- lookup_name ie (ieWrappedName tc') @@ -1345,7 +1344,7 @@ filterImports hsc_env iface decl_spec (Just (want_hiding, L l import_items)) -- See Note [Importing DuplicateRecordFields] case lookupChildren subnames rdr_ns of - Failed rdrs -> failLookupWith (BadImport (IEThingWith xt ltc wc rdrs)) + Failed rdrs -> failLookupWith (BadImport (IEThingWith xt ltc wc rdrs) BadImportIsSubordinate) -- We are trying to import T( a,b,c,d ), and failed -- to find 'b' and 'd'. So we make up an import item -- to report as failing, namely T( b, d ). @@ -1369,7 +1368,7 @@ filterImports hsc_env iface decl_spec (Just (want_hiding, L l import_items)) where n = greName gre handle_bad_import m = catchIELookup m $ \err -> case err of - BadImport ie | want_hiding == EverythingBut -> return ([], [BadImportW ie]) + BadImport ie _ | want_hiding == EverythingBut -> return ([], [BadImportW ie]) _ -> failLookupWith err type IELookupM = MaybeErr IELookupError @@ -1379,9 +1378,11 @@ data IELookupWarning | MissingImportList | DodgyImport GlobalRdrElt +data BadImportIsSubordinate = BadImportIsParent | BadImportIsSubordinate + data IELookupError = QualImportError RdrName - | BadImport (IE GhcPs) + | BadImport (IE GhcPs) BadImportIsSubordinate | IllegalImport | AmbiguousImport RdrName [GlobalRdrElt] -- e.g. a duplicated field name as a top-level import @@ -2136,67 +2137,60 @@ DRFPatSynExport for a test of this. ************************************************************************ -} -qualImportItemErr :: RdrName -> SDoc +qualImportItemErr :: RdrName -> TcRn () qualImportItemErr rdr - = hang (text "Illegal qualified name in import item:") + = addErr $ mkTcRnUnknownMessage $ mkPlainError noHints $ + hang (text "Illegal qualified name in import item:") 2 (ppr rdr) -ambiguousImportItemErr :: RdrName -> [GlobalRdrElt] -> SDoc +ambiguousImportItemErr :: RdrName -> [GlobalRdrElt] -> TcRn () ambiguousImportItemErr rdr gres - = hang (text "Ambiguous name" <+> quotes (ppr rdr) <+> text "in import item. It could refer to:") - 2 (vcat (map (ppr . greOccName) gres)) - -pprImpDeclSpec :: ModIface -> ImpDeclSpec -> SDoc -pprImpDeclSpec iface decl_spec = - quotes (ppr (is_mod decl_spec)) <+> case mi_boot iface of - IsBoot -> text "(hi-boot interface)" - NotBoot -> Outputable.empty - -badImportItemErrStd :: ModIface -> ImpDeclSpec -> IE GhcPs -> SDoc -badImportItemErrStd iface decl_spec ie - = sep [text "Module", pprImpDeclSpec iface decl_spec, - text "does not export", quotes (ppr ie)] - -badImportItemErrDataCon :: OccName -> ModIface -> ImpDeclSpec -> IE GhcPs - -> SDoc -badImportItemErrDataCon dataType_occ iface decl_spec ie - = vcat [ text "In module" - <+> pprImpDeclSpec iface decl_spec - <> colon - , nest 2 $ quotes datacon - <+> text "is a data constructor of" - <+> quotes dataType - , text "To import it use" - , nest 2 $ text "import" - <+> ppr (is_mod decl_spec) - <> parens_sp (dataType <> parens_sp datacon) - , text "or" - , nest 2 $ text "import" - <+> ppr (is_mod decl_spec) - <> parens_sp (dataType <> text "(..)") - ] + = addErr $ mkTcRnUnknownMessage $ mkPlainError noHints err where - datacon_occ = rdrNameOcc $ ieName ie - datacon = parenSymOcc datacon_occ (ppr datacon_occ) - dataType = parenSymOcc dataType_occ (ppr dataType_occ) - parens_sp d = parens (space <> d <> space) -- T( f,g ) - -badImportItemErr :: ModIface -> ImpDeclSpec -> IE GhcPs -> [AvailInfo] -> SDoc -badImportItemErr iface decl_spec ie avails - = case find checkIfDataCon avails of - Just con -> badImportItemErrDataCon (availOccName con) iface decl_spec ie - Nothing -> badImportItemErrStd iface decl_spec ie + err = hang (text "Ambiguous name" <+> quotes (ppr rdr) <+> text "in import item. It could refer to:") + 2 (vcat (map (ppr . greOccName) gres)) + +badImportItemErr + :: ModIface -> ImpDeclSpec -> IE GhcPs -> BadImportIsSubordinate + -> [AvailInfo] + -> ImportListInterpretation + -> TcRn () +badImportItemErr iface decl_spec ie sub avails ili + = do { patsyns_enabled <- xoptM LangExt.PatternSynonyms + ; let err = TcRnBadImport importErrorKind iface decl_spec ie patsyns_enabled ili + ; case ili of + EverythingBut -> addTcRnDiagnostic err + Exactly -> addErr err } where - checkIfDataCon (AvailTC _ ns) = - case find (\n -> importedFS == occNameFS (occName n)) ns of - Just n -> isDataConName n - Nothing -> False - checkIfDataCon _ = False + importErrorKind + | any checkIfTyCon avails = case sub of + BadImportIsParent -> BadImportAvailTyCon + BadImportIsSubordinate -> BadImportNotExportedSubordinates unavailableChildren + | any checkIfVarName avails = BadImportAvailVar + | Just con <- find checkIfDataCon avails = BadImportAvailDataCon (availOccName con) + | otherwise = BadImportNotExported + checkIfDataCon = checkIfAvailMatches isDataConName + checkIfTyCon = checkIfAvailMatches isTyConName + checkIfVarName = + \case + AvailTC{} -> False + Avail n -> importedFS == occNameFS (occName n) + && (isVarOcc <||> isFieldOcc) (occName n) + checkIfAvailMatches namePred = + \case + AvailTC _ ns -> + case find (\n -> importedFS == occNameFS (occName n)) ns of + Just n -> namePred n + Nothing -> False + Avail{} -> False availOccName = occName . availName importedFS = occNameFS . rdrNameOcc $ ieName ie + unavailableChildren = map (rdrNameOcc) $ case ie of + IEThingWith _ _ _ ns -> map (ieWrappedName . unLoc) ns + _ -> panic "importedChildren failed pattern match: no children" -illegalImportItemErr :: SDoc -illegalImportItemErr = text "Illegal import item" +illegalImportItemErr :: TcRn () +illegalImportItemErr = addErr $ mkTcRnUnknownMessage $ mkPlainError noHints $ text "Illegal import item" addDupDeclErr :: NonEmpty GlobalRdrElt -> TcRn () addDupDeclErr gres@(gre :| _) @@ -2212,7 +2206,7 @@ addDupDeclErr gres@(gre :| _) where sorted_names = NE.sortBy (SrcLoc.leftmost_smallest `on` nameSrcSpan) - (fmap greName gres) + (fmap greName gres) missingImportListWarn :: ModuleName -> SDoc missingImportListWarn mod diff --git a/compiler/GHC/Rename/Unbound.hs b/compiler/GHC/Rename/Unbound.hs index ee9f2c82b8..199cebbaa9 100644 --- a/compiler/GHC/Rename/Unbound.hs +++ b/compiler/GHC/Rename/Unbound.hs @@ -195,7 +195,7 @@ unknownNameSuggestions_ looking_for dflags hpt curr_mod global_env local_env suggs = mconcat [ if_ne (SuggestSimilarNames tried_rdr_name) $ similarNameSuggestions looking_for dflags global_env local_env tried_rdr_name - , map ImportSuggestion imp_suggs + , map (ImportSuggestion $ rdrNameOcc tried_rdr_name) imp_suggs , extensionSuggestions tried_rdr_name , fieldSelectorSuggestions global_env tried_rdr_name ] (imp_errs, imp_suggs) = importSuggestions looking_for global_env hpt curr_mod imports tried_rdr_name @@ -321,9 +321,9 @@ importSuggestions looking_for global_env hpt currMod imports rdr_name , (mod : mods) <- map fst interesting_imports = ([ModulesDoNotExport (mod :| mods) occ_name], []) | mod : mods <- helpful_imports_non_hiding - = ([], [CouldImportFrom (mod :| mods) occ_name]) + = ([], [CouldImportFrom (mod :| mods)]) | mod : mods <- helpful_imports_hiding - = ([], [CouldUnhideFrom (mod :| mods) occ_name]) + = ([], [CouldUnhideFrom (mod :| mods)]) | otherwise = ([], []) where diff --git a/compiler/GHC/Rename/Utils.hs b/compiler/GHC/Rename/Utils.hs index 4992ebf309..a00d97dd0d 100644 --- a/compiler/GHC/Rename/Utils.hs +++ b/compiler/GHC/Rename/Utils.hs @@ -565,8 +565,8 @@ mkNameClashErr :: Outputable a mkNameClashErr rdr_name gres = mkTcRnUnknownMessage $ mkPlainError noHints $ (vcat [ text "Ambiguous occurrence" <+> quotes (ppr rdr_name) - , text "It could refer to" - , nest 3 (vcat (msg1 : msgs)) ]) + , text "It could refer to" + , nest 3 (vcat (msg1 : msgs)) ]) where np1 NE.:| nps = gres msg1 = text "either" <+> ppr_gre np1 diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs index 5cc8ab5f64..33c67fee79 100644 --- a/compiler/GHC/Tc/Errors/Ppr.hs +++ b/compiler/GHC/Tc/Errors/Ppr.hs @@ -29,6 +29,10 @@ import GHC.Prelude import GHC.Builtin.Names import GHC.Builtin.Types ( boxedRepDataConTyCon, tYPETyCon, filterCTuple ) +import GHC.Types.Name.Reader +import GHC.Unit.Module.ModIface +import GHC.Unit.Module.Warnings + import GHC.Core.Coercion import GHC.Core.Unify ( tcMatchTys ) import GHC.Core.TyCon @@ -58,14 +62,13 @@ import GHC.Tc.Types.Rank (Rank(..)) import GHC.Tc.Utils.TcType import GHC.Types.Error -import GHC.Types.Hint (UntickedPromotedThing(..), pprUntickedConstructor, isBareSymbol) +import GHC.Types.Hint import GHC.Types.Hint.Ppr () -- Outputable GhcHint import GHC.Types.Basic import GHC.Types.Error.Codes ( constructorCode ) import GHC.Types.Id import GHC.Types.Id.Info ( RecSelParent(..) ) import GHC.Types.Name -import GHC.Types.Name.Reader import GHC.Types.Name.Env import GHC.Types.Name.Set import GHC.Types.SrcLoc @@ -78,7 +81,6 @@ import GHC.Types.Fixity (defaultFixity) import GHC.Unit.State import GHC.Unit.Module -import GHC.Unit.Module.Warnings ( warningTxtCategory, pprWarningTxtForMsg ) import GHC.Data.Bag import GHC.Data.FastString @@ -876,9 +878,9 @@ instance Diagnostic TcRnMessage where in case why of NotADataType -> quotes (ppr ty) <+> text "is not a data type" - NewtypeDataConNotInScope Nothing -> + NewtypeDataConNotInScope _ [] -> hang innerMsg 2 $ text "because its data constructor is not in scope" - NewtypeDataConNotInScope (Just tc) -> + NewtypeDataConNotInScope tc _ -> hang innerMsg 2 $ text "because the data constructor for" <+> quotes (ppr tc) <+> text "is not in scope" @@ -1113,6 +1115,58 @@ instance Diagnostic TcRnMessage where TcRnTypeDataForbids feature -> mkSimpleDecorated $ ppr feature <+> text "are not allowed in type data declarations." + TcRnBadImport k iface decl_spec ie _ps _interp -> + mkSimpleDecorated $ + let + pprImpDeclSpec :: ModIface -> ImpDeclSpec -> SDoc + pprImpDeclSpec iface decl_spec = + quotes (ppr (is_mod decl_spec)) <+> case mi_boot iface of + IsBoot -> text "(hi-boot interface)" + NotBoot -> empty + withContext msgs = + hang (text "In the import of" <+> pprImpDeclSpec iface decl_spec <> colon) + 2 (vcat msgs) + in case k of + BadImportNotExported -> + vcat + [ text "Module" <+> pprImpDeclSpec iface decl_spec <+> + text "does not export" <+> quotes (ppr ie) <> dot + ] + BadImportAvailVar -> + withContext + [ text "an item called" + <+> quotes val <+> text "is exported, but it is not a type." + ] + where + val_occ = rdrNameOcc $ ieName ie + val = parenSymOcc val_occ (ppr val_occ) + BadImportAvailTyCon {} -> + withContext + [ text "an item called" + <+> quotes tycon <+> text "is exported, but it is a type." + ] + where + tycon_occ = rdrNameOcc $ ieName ie + tycon = parenSymOcc tycon_occ (ppr tycon_occ) + BadImportNotExportedSubordinates ns -> + withContext + [ text "an item called" <+> quotes sub <+> text "is exported, but it does not export any children" + , text "(constructors, class methods or field names) called" + <+> pprWithCommas (quotes . ppr) ns <> dot + ] + where + sub_occ = rdrNameOcc $ ieName ie + sub = parenSymOcc sub_occ (ppr sub_occ) + BadImportAvailDataCon dataType_occ -> + withContext + [ text "an item called" <+> quotes datacon + , text "is exported, but it is a data constructor of" + , quotes dataType <> dot + ] + where + datacon_occ = rdrNameOcc $ ieName ie + datacon = parenSymOcc datacon_occ (ppr datacon_occ) + dataType = parenSymOcc dataType_occ (ppr dataType_occ) TcRnIllegalNewtype con show_linear_types reason -> mkSimpleDecorated $ @@ -2311,7 +2365,10 @@ instance Diagnostic TcRnMessage where -> ErrorWithoutFlag TcRnInterfaceError err -> interfaceErrorReason err - + TcRnBadImport _ _ _ _ _ importKind + -> case importKind of + Exactly -> ErrorWithoutFlag + EverythingBut -> WarningWithFlag Opt_WarnDodgyImports diagnosticHints = \case TcRnUnknownMessage m @@ -2582,8 +2639,13 @@ instance Diagnostic TcRnMessage where TcRnIllegalForeignType _ reason -> case reason of TypeCannotBeMarshaled _ why - | NewtypeDataConNotInScope{} <- why -> [SuggestImportingDataCon] - | UnliftedFFITypesNeeded <- why -> [suggestExtension LangExt.UnliftedFFITypes] + | NewtypeDataConNotInScope tc _ <- why + -> let tc_nm = tyConName tc + dc = dataConName $ head $ tyConDataCons tc + in [ ImportSuggestion (occName dc) + $ ImportDataCon Nothing (nameOccName tc_nm) ] + | UnliftedFFITypesNeeded <- why + -> [suggestExtension LangExt.UnliftedFFITypes] _ -> noHints TcRnInvalidCIdentifier{} -> noHints @@ -2913,7 +2975,17 @@ instance Diagnostic TcRnMessage where -> [SuggestAddTypeSignatures UnnamedBinding] TcRnInterfaceError reason -> interfaceErrorHints reason - + TcRnBadImport k _ is ie patsyns_enabled _ -> + let mod = is_mod is + occ = rdrNameOcc $ ieName ie + in case k of + BadImportAvailVar -> [ImportSuggestion occ $ CouldRemoveTypeKeyword mod] + BadImportNotExported -> noHints + BadImportAvailTyCon -> [ImportSuggestion occ $ CouldAddTypeKeyword (is_mod is)] + BadImportAvailDataCon par -> [ImportSuggestion occ $ ImportDataCon (Just (is_mod is, patsyns_enabled)) par] + BadImportNotExportedSubordinates{} -> noHints + + diagnosticCode :: TcRnMessage -> Maybe DiagnosticCode diagnosticCode = constructorCode -- | Change [x] to "x", [x, y] to "x and y", [x, y, z] to "x, y, and z", @@ -4841,7 +4913,7 @@ expandSynonymsToMatch ty1 ty2 = (ty1_ret, ty2_ret) -- ... -- type T0 = Int -- - -- `tyExpansions T10` returns [T9, T8, T7, ... Int] + -- `tyExpansions T10` returns [T9, T8, T7, ..., Int] -- -- This only expands the top layer, so if you have: -- diff --git a/compiler/GHC/Tc/Errors/Types.hs b/compiler/GHC/Tc/Errors/Types.hs index 38615d0f0d..e2a69e0ce2 100644 --- a/compiler/GHC/Tc/Errors/Types.hs +++ b/compiler/GHC/Tc/Errors/Types.hs @@ -109,6 +109,7 @@ module GHC.Tc.Errors.Types ( , HsTypeOrSigType(..) , HsTyVarBndrExistentialFlag(..) , TySynCycleTyCons + , BadImportKind(..) ) where import GHC.Prelude @@ -123,9 +124,9 @@ import GHC.Tc.Types.Origin ( CtOrigin (ProvCtxtOrigin), SkolemInfoAnon (SigSkol) , FixedRuntimeRepOrigin(..), InstanceWhat ) import GHC.Tc.Types.Rank (Rank) import GHC.Tc.Utils.TcType (IllegalForeignTypeReason, TcType, TcSigmaType, TcPredType) -import GHC.Types.Avail (AvailInfo) import GHC.Types.Basic import GHC.Types.Error +import GHC.Types.Avail import GHC.Types.Hint (UntickedPromotedThing(..)) import GHC.Types.ForeignCall (CLabelString) import GHC.Types.Id.Info ( RecSelParent(..) ) @@ -163,6 +164,7 @@ import qualified Data.List.NonEmpty as NE import Data.Typeable (Typeable) import GHC.Unit.Module.Warnings (WarningCategory, WarningTxt) import qualified Language.Haskell.TH.Syntax as TH +import GHC.Unit.Module.ModIface import GHC.Generics ( Generic ) import GHC.Types.Name.Env (NameEnv) @@ -2935,6 +2937,21 @@ data TcRnMessage where rename/should_fail/T5657 -} TcRnSectionWithoutParentheses :: HsExpr GhcPs -> TcRnMessage + {-| TcRnBadImport is an error that occurs in cases where an item in an import + statement is not exported by the corresponding module. + When a nonexistent item is included in the 'hiding' section of an import + statement, this becomes a warning instead, controlled by -Wdodgy-imports. + + Test cases: + testsuite/tests/module/should_fail/T21826.hs + -} + TcRnBadImport :: BadImportKind + -> ModIface + -> ImpDeclSpec + -> IE GhcPs + -> Bool -- ^ whether @-XPatternSynonyms@ was enabled + -> ImportListInterpretation + -> TcRnMessage {- TcRnBindingOfExistingName is an error triggered by an attempt to rebind built-in syntax, punned list or tuple syntax, or a name quoted via Template Haskell. @@ -4751,6 +4768,20 @@ data WhenMatching = WhenMatching TcType TcType CtOrigin (Maybe TypeOrKind) deriving Generic +data BadImportKind + -- | Module does not export... + = BadImportNotExported + -- | Missing @type@ keyword when importing a type. + | BadImportAvailTyCon + -- | Trying to import a data constructor directly, e.g. + -- @import Data.Maybe (Just)@ instead of @import Data.Maybe (Maybe(Just))@ + | BadImportAvailDataCon OccName + -- | The parent does not export the given children. + | BadImportNotExportedSubordinates [OccName] + -- | Incorrect @type@ keyword when importing something which isn't a type. + | BadImportAvailVar + deriving Generic + -- | Some form of @"not in scope"@ error. See also the 'OutOfScopeHole' -- constructor of 'HoleError'. data NotInScopeError diff --git a/compiler/GHC/Tc/Utils/TcType.hs b/compiler/GHC/Tc/Utils/TcType.hs index 845e954b83..e7d33c3a80 100644 --- a/compiler/GHC/Tc/Utils/TcType.hs +++ b/compiler/GHC/Tc/Utils/TcType.hs @@ -2071,7 +2071,7 @@ data IllegalForeignTypeReason -- | Reason why a type cannot be marshalled through the FFI. data TypeCannotBeMarshaledReason = NotADataType - | NewtypeDataConNotInScope !(Maybe TyCon) + | NewtypeDataConNotInScope !TyCon ![Type] | UnliftedFFITypesNeeded | NotABoxedMarshalableTyCon | ForeignLabelNotAPtr @@ -2180,9 +2180,7 @@ checkRepTyCon check_tc ty | otherwise -> check_tc tc Nothing -> NotValid NotADataType where - mk_nt_reason tc tys - | null tys = NewtypeDataConNotInScope Nothing - | otherwise = NewtypeDataConNotInScope (Just tc) + mk_nt_reason tc tys = NewtypeDataConNotInScope tc tys {- Note [Foreign import dynamic] diff --git a/compiler/GHC/Types/Error/Codes.hs b/compiler/GHC/Types/Error/Codes.hs index e5d7a84bb6..9c2f7d1dc3 100644 --- a/compiler/GHC/Types/Error/Codes.hs +++ b/compiler/GHC/Types/Error/Codes.hs @@ -620,6 +620,13 @@ type family GhcDiagnosticCode c = n | n -> c where GhcDiagnosticCode "MultiplePossibleParents" = 99339 GhcDiagnosticCode "InvalidTyConParent" = 33238 + -- BadImport + GhcDiagnosticCode "BadImportNotExported" = 61689 + GhcDiagnosticCode "BadImportAvailDataCon" = 35373 + GhcDiagnosticCode "BadImportNotExportedSubordinates" = 10237 + GhcDiagnosticCode "BadImportAvailTyCon" = 56449 + GhcDiagnosticCode "BadImportAvailVar" = 12112 + -- TcRnPragmaWarning GhcDiagnosticCode "WarningTxt" = 63394 GhcDiagnosticCode "DeprecatedTxt" = 68441 @@ -853,6 +860,10 @@ type family ConRecursInto con where ConRecursInto "DsUnknownMessage" = 'Just UnknownDiagnostic ---------------------------------- + -- Constructors of TcRnBadImport + ConRecursInto "TcRnBadImport" = 'Just BadImportKind + + ---------------------------------- -- Any other constructors: don't recur, instead directly -- use the constructor name for the error code. diff --git a/compiler/GHC/Types/Hint.hs b/compiler/GHC/Types/Hint.hs index 635b965035..c715a8f05e 100644 --- a/compiler/GHC/Types/Hint.hs +++ b/compiler/GHC/Types/Hint.hs @@ -402,16 +402,9 @@ data GhcHint Test cases: mod28, mod36, mod87, mod114, ... -} - | ImportSuggestion ImportSuggestion + | ImportSuggestion OccName ImportSuggestion - {-| Suggest importing a data constructor to bring it into scope - Triggered by: 'GHC.Tc.Errors.Types.TcRnTypeCannotBeMarshaled' - - Test cases: ccfail004 - -} - | SuggestImportingDataCon - {-| Found a pragma in the body of a module, suggest - placing it in the header + {-| Found a pragma in the body of a module, suggest placing it in the header. -} | SuggestPlacePragmaInHeader {-| Suggest using pattern matching syntax for a non-bidirectional pattern synonym @@ -452,9 +445,23 @@ data InstantiationSuggestion = InstantiationSuggestion !ModuleName !Module -- | Suggest how to fix an import. data ImportSuggestion -- | Some module exports what we want, but we aren't explicitly importing it. - = CouldImportFrom (NE.NonEmpty (Module, ImportedModsVal)) OccName + = CouldImportFrom (NE.NonEmpty (Module, ImportedModsVal)) -- | Some module exports what we want, but we are explicitly hiding it. - | CouldUnhideFrom (NE.NonEmpty (Module, ImportedModsVal)) OccName + | CouldUnhideFrom (NE.NonEmpty (Module, ImportedModsVal)) + -- | The module exports what we want, but it isn't a type. + | CouldRemoveTypeKeyword ModuleName + -- | The module exports what we want, but it's a type and we have @ExplicitNamespaces@ on. + | CouldAddTypeKeyword ModuleName + -- | Suggest importing a data constructor to bring it into scope + | ImportDataCon + -- | Where to suggest importing the 'DataCon' from. + -- + -- The 'Bool' tracks whether to suggest using an import of the form + -- @import (pattern Foo)@, depending on whether @-XPatternSynonyms@ + -- was enabled. + { ies_suggest_import_from :: Maybe (ModuleName, Bool) + -- | The 'OccName' of the parent of the data constructor. + , ies_parent :: OccName } -- | Explain how something is in scope. data HowInScope diff --git a/compiler/GHC/Types/Hint/Ppr.hs b/compiler/GHC/Types/Hint/Ppr.hs index 641dbb1691..774d27ac7c 100644 --- a/compiler/GHC/Types/Hint/Ppr.hs +++ b/compiler/GHC/Types/Hint/Ppr.hs @@ -16,7 +16,7 @@ import GHC.Core.FamInstEnv (FamFlavor(..)) import GHC.Hs.Expr () -- instance Outputable import {-# SOURCE #-} GHC.Tc.Types.Origin ( ClsInstOrQC(..) ) import GHC.Types.Id -import GHC.Types.Name (NameSpace, pprDefinedAt, occNameSpace, pprNameSpace, isValNameSpace, nameModule) +import GHC.Types.Name import GHC.Types.Name.Reader (RdrName,ImpDeclSpec (..), rdrNameOcc, rdrNameSpace) import GHC.Types.SrcLoc (SrcSpan(..), srcSpanStartLine) import GHC.Unit.Module.Imported (ImportedModsVal(..)) @@ -199,10 +199,8 @@ instance Outputable GhcHint where whose | null parents = empty | otherwise = text "belonging to the type" <> plural parents <+> pprQuotedList parents - ImportSuggestion import_suggestion - -> pprImportSuggestion import_suggestion - SuggestImportingDataCon - -> text "Import the data constructor to bring it into scope" + ImportSuggestion occ_name import_suggestion + -> pprImportSuggestion occ_name import_suggestion SuggestPlacePragmaInHeader -> text "Perhaps you meant to place it in the module header?" $$ text "The module header is the section at the top of the file, before the" <+> quotes (text "module") <+> text "keyword" @@ -237,50 +235,88 @@ perhapsAsPat :: SDoc perhapsAsPat = text "Perhaps you meant an as-pattern, which must not be surrounded by whitespace" -- | Pretty-print an 'ImportSuggestion'. -pprImportSuggestion :: ImportSuggestion -> SDoc -pprImportSuggestion (CouldImportFrom mods occ_name) +pprImportSuggestion :: OccName -> ImportSuggestion -> SDoc +pprImportSuggestion occ_name (CouldImportFrom mods) | (mod, imv) NE.:| [] <- mods = fsep - [ text "Perhaps you want to add" + [ text "Add" , quotes (ppr occ_name) , text "to the import list" , text "in the import of" , quotes (ppr mod) - , parens (ppr (imv_span imv)) <> dot + , parens (text "at" <+> ppr (imv_span imv)) <> dot ] | otherwise = fsep - [ text "Perhaps you want to add" + [ text "Add" , quotes (ppr occ_name) , text "to one of these import lists:" ] $$ nest 2 (vcat - [ quotes (ppr mod) <+> parens (ppr (imv_span imv)) + [ quotes (ppr mod) <+> parens (text "at" <+> ppr (imv_span imv)) | (mod,imv) <- NE.toList mods ]) -pprImportSuggestion (CouldUnhideFrom mods occ_name) +pprImportSuggestion occ_name (CouldUnhideFrom mods) | (mod, imv) NE.:| [] <- mods = fsep - [ text "Perhaps you want to remove" + [ text "Remove" , quotes (ppr occ_name) , text "from the explicit hiding list" , text "in the import of" , quotes (ppr mod) - , parens (ppr (imv_span imv)) <> dot + , parens (text "at" <+> ppr (imv_span imv)) <> dot ] | otherwise = fsep - [ text "Perhaps you want to remove" + [ text "Remove" , quotes (ppr occ_name) , text "from the hiding clauses" , text "in one of these imports:" ] $$ nest 2 (vcat - [ quotes (ppr mod) <+> parens (ppr (imv_span imv)) + [ quotes (ppr mod) <+> parens (text "at" <+> ppr (imv_span imv)) | (mod,imv) <- NE.toList mods ]) +pprImportSuggestion occ_name (CouldAddTypeKeyword mod) + = vcat [ text "Add the" <+> quotes (text "type") + <+> text "keyword to the import statement:" + , nest 2 $ text "import" + <+> ppr mod + <+> parens_sp (text "type" <+> pprPrefixOcc occ_name) + ] + where + parens_sp d = parens (space <> d <> space) +pprImportSuggestion occ_name (CouldRemoveTypeKeyword mod) + = vcat [ text "Remove the" <+> quotes (text "type") + <+> text "keyword from the import statement:" + , nest 2 $ text "import" + <+> ppr mod + <+> parens_sp (pprPrefixOcc occ_name) ] + where + parens_sp d = parens (space <> d <> space) +pprImportSuggestion dc_occ (ImportDataCon Nothing parent_occ) + = text "Import the data constructor" <+> quotes (ppr dc_occ) <+> + text "of" <+> quotes (ppr parent_occ) +pprImportSuggestion dc_occ (ImportDataCon (Just (mod, patsyns_enabled)) parent_occ) + = vcat $ [ text "Use" + , nest 2 $ text "import" + <+> ppr mod + <+> parens_sp (pprPrefixOcc parent_occ <> parens_sp (pprPrefixOcc dc_occ)) + , text "or" + , nest 2 $ text "import" + <+> ppr mod + <+> parens_sp (pprPrefixOcc parent_occ <> text "(..)") + ] ++ if patsyns_enabled + then [ text "or" + , nest 2 $ text "import" + <+> ppr mod + <+> parens_sp (text "pattern" <+> pprPrefixOcc dc_occ) + ] + else [] + where + parens_sp d = parens (space <> d <> space) -- | Pretty-print a 'SimilarName'. pprSimilarName :: NameSpace -> SimilarName -> SDoc diff --git a/testsuite/tests/driver/recomp001/recomp001.stderr b/testsuite/tests/driver/recomp001/recomp001.stderr index 724326e081..1ca9ce8c1d 100644 --- a/testsuite/tests/driver/recomp001/recomp001.stderr +++ b/testsuite/tests/driver/recomp001/recomp001.stderr @@ -1,2 +1,2 @@ -C.hs:3:11: Module ‘B’ does not export ‘foo’ +C.hs:3:11: error: [GHC-61689] Module ‘B’ does not export ‘foo’. diff --git a/testsuite/tests/driver/retc001/retc001.stderr b/testsuite/tests/driver/retc001/retc001.stderr index 724326e081..1ca9ce8c1d 100644 --- a/testsuite/tests/driver/retc001/retc001.stderr +++ b/testsuite/tests/driver/retc001/retc001.stderr @@ -1,2 +1,2 @@ -C.hs:3:11: Module ‘B’ does not export ‘foo’ +C.hs:3:11: error: [GHC-61689] Module ‘B’ does not export ‘foo’. diff --git a/testsuite/tests/ffi/should_fail/ccfail004.stderr b/testsuite/tests/ffi/should_fail/ccfail004.stderr index b597a6d73e..e9fa134864 100644 --- a/testsuite/tests/ffi/should_fail/ccfail004.stderr +++ b/testsuite/tests/ffi/should_fail/ccfail004.stderr @@ -5,7 +5,7 @@ ccfail004.hs:9:1: error: [GHC-72317] because its data constructor is not in scope • When checking declaration: foreign import ccall safe f1 :: NInt -> IO Int - Suggested fix: Import the data constructor to bring it into scope + Suggested fix: Import the data constructor ‘NInt’ of ‘NInt’ ccfail004.hs:10:1: error: [GHC-72317] • Unacceptable result type in foreign declaration: @@ -13,7 +13,7 @@ ccfail004.hs:10:1: error: [GHC-72317] because its data constructor is not in scope • When checking declaration: foreign import ccall safe f2 :: Int -> IO NInt - Suggested fix: Import the data constructor to bring it into scope + Suggested fix: Import the data constructor ‘NInt’ of ‘NInt’ ccfail004.hs:11:1: error: [GHC-72317] • Unacceptable result type in foreign declaration: @@ -21,7 +21,7 @@ ccfail004.hs:11:1: error: [GHC-72317] because the data constructor for ‘NIO’ is not in scope • When checking declaration: foreign import ccall safe f3 :: Int -> NIO Int - Suggested fix: Import the data constructor to bring it into scope + Suggested fix: Import the data constructor ‘NIO’ of ‘NIO’ ccfail004.hs:14:1: error: [GHC-89401] • Unacceptable argument type in foreign declaration: diff --git a/testsuite/tests/ghc-e/should_fail/T9905fail2.stderr b/testsuite/tests/ghc-e/should_fail/T9905fail2.stderr index 8be6c2aadb..1d402d0794 100644 --- a/testsuite/tests/ghc-e/should_fail/T9905fail2.stderr +++ b/testsuite/tests/ghc-e/should_fail/T9905fail2.stderr @@ -1,4 +1,4 @@ -<interactive>:0:19: error: - Module ‘Data.List’ does not export ‘bogusIdentifier’ +<interactive>:0:19: error: [GHC-61689] + Module ‘Data.List’ does not export ‘bogusIdentifier’. 1 diff --git a/testsuite/tests/ghci/scripts/T6007.stderr b/testsuite/tests/ghci/scripts/T6007.stderr index bd5c31dd57..83c1acac1d 100644 --- a/testsuite/tests/ghci/scripts/T6007.stderr +++ b/testsuite/tests/ghci/scripts/T6007.stderr @@ -1,6 +1,6 @@ -<interactive>:1:19: - Module ‘System.IO’ does not export ‘does_not_exist’ +<interactive>:1:19: error: [GHC-61689] + Module ‘System.IO’ does not export ‘does_not_exist’. -<interactive>:3:20: - Module ‘Data.Maybe’ does not export ‘does_not_exist’ +<interactive>:3:20: error: [GHC-61689] + Module ‘Data.Maybe’ does not export ‘does_not_exist’. diff --git a/testsuite/tests/module/T21826.hs b/testsuite/tests/module/T21826.hs new file mode 100644 index 0000000000..71fd3b4552 --- /dev/null +++ b/testsuite/tests/module/T21826.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE ExplicitNamespaces #-} +{-# LANGUAGE PatternSynonyms #-} +import Data.Type.Equality ( (~) ) +import Data.Maybe ( Just ) +import Data.Maybe ( Some ) +import Data.Maybe ( Maybe(Some) ) +import Data.Maybe ( Maybe(Just,Some,Mk) ) +import Data.List ( type (!!) ) + +import Data.Type.Equality ( pattern (:~:) ) +import Data.Maybe ( pattern Just ) +import Data.Maybe ( pattern Some ) +import Data.Maybe ( pattern Maybe ) diff --git a/testsuite/tests/module/T21826.stderr b/testsuite/tests/module/T21826.stderr new file mode 100644 index 0000000000..f59a082436 --- /dev/null +++ b/testsuite/tests/module/T21826.stderr @@ -0,0 +1,57 @@ + +T21826.hs:3:29: error: [GHC-56449] + In the import of ‘Data.Type.Equality’: + an item called ‘(~)’ is exported, but it is a type. + Suggested fix: + Add the ‘type’ keyword to the import statement: + import Data.Type.Equality ( type (~) ) + +T21826.hs:4:21: error: [GHC-35373] + In the import of ‘Data.Maybe’: + an item called ‘Just’ + is exported, but it is a data constructor of + ‘Maybe’. + Suggested fix: + Use + import Data.Maybe ( Maybe( Just ) ) + or + import Data.Maybe ( Maybe(..) ) + or + import Data.Maybe ( pattern Just ) + +T21826.hs:5:21: error: [GHC-61689] + Module ‘Data.Maybe’ does not export ‘Some’. + +T21826.hs:6:21: error: [GHC-10237] + In the import of ‘Data.Maybe’: + an item called ‘Maybe’ is exported, but it does not export any children + (constructors, class methods or field names) called ‘Some’. + +T21826.hs:7:21: error: [GHC-10237] + In the import of ‘Data.Maybe’: + an item called ‘Maybe’ is exported, but it does not export any children + (constructors, class methods or field names) called ‘Some’, ‘Mk’. + +T21826.hs:8:20: error: [GHC-12112] + In the import of ‘Data.List’: + an item called ‘(!!)’ is exported, but it is not a type. + Suggested fix: + Remove the ‘type’ keyword from the import statement: + import Data.List ( (!!) ) + +T21826.hs:10:29: error: [GHC-56449] + In the import of ‘Data.Type.Equality’: + an item called ‘(:~:)’ is exported, but it is a type. + Suggested fix: + Add the ‘type’ keyword to the import statement: + import Data.Type.Equality ( type (:~:) ) + +T21826.hs:12:21: error: [GHC-61689] + Module ‘Data.Maybe’ does not export ‘pattern Some’. + +T21826.hs:13:21: error: [GHC-56449] + In the import of ‘Data.Maybe’: + an item called ‘Maybe’ is exported, but it is a type. + Suggested fix: + Add the ‘type’ keyword to the import statement: + import Data.Maybe ( type Maybe ) diff --git a/testsuite/tests/module/all.T b/testsuite/tests/module/all.T index 516a252b8c..197e89bbb4 100644 --- a/testsuite/tests/module/all.T +++ b/testsuite/tests/module/all.T @@ -297,3 +297,4 @@ test('T20562', normal, compile, ['']) test('T21752', [extra_files(['T21752A.hs', 'T21752.hs'])], multimod_compile, ['T21752', '-v0']) test('TupleTyConUserSyntax', [extra_files(['TupleTyConUserSyntaxA.hs', 'TupleTyConUserSyntax.hs'])], multimod_compile, ['TupleTyConUserSyntax', '-v0']) +test('T21826', normal, compile_fail, ['']) diff --git a/testsuite/tests/module/mod114.stderr b/testsuite/tests/module/mod114.stderr index 5b50ec52fb..bc465e6ac3 100644 --- a/testsuite/tests/module/mod114.stderr +++ b/testsuite/tests/module/mod114.stderr @@ -2,5 +2,5 @@ mod114.hs:3:16: error: [GHC-76037] Not in scope: type constructor or class ‘Stuff’ Suggested fix: - Perhaps you want to remove ‘Stuff’ from the explicit hiding list - in the import of ‘Mod114_Help’ (mod114.hs:4:1-36). + Remove ‘Stuff’ from the explicit hiding list in the import of + ‘Mod114_Help’ (at mod114.hs:4:1-36). diff --git a/testsuite/tests/module/mod124.stderr b/testsuite/tests/module/mod124.stderr index 9c9009ff93..5e51cfeb8b 100644 --- a/testsuite/tests/module/mod124.stderr +++ b/testsuite/tests/module/mod124.stderr @@ -2,5 +2,5 @@ mod124.hs:6:6: error: [GHC-76037] Not in scope: type constructor or class ‘T’ Suggested fix: - Perhaps you want to remove ‘T’ from the explicit hiding list - in the import of ‘Mod124_A’ (mod124.hs:4:1-26). + Remove ‘T’ from the explicit hiding list in the import of + ‘Mod124_A’ (at mod124.hs:4:1-26). diff --git a/testsuite/tests/module/mod125.stderr b/testsuite/tests/module/mod125.stderr index 4882d689ce..26e909ab77 100644 --- a/testsuite/tests/module/mod125.stderr +++ b/testsuite/tests/module/mod125.stderr @@ -2,5 +2,5 @@ mod125.hs:7:5: error: [GHC-88464] Data constructor not in scope: T Suggested fix: - Perhaps you want to remove ‘T’ from the explicit hiding list - in the import of ‘Mod125_A’ (mod125.hs:4:1-26). + Remove ‘T’ from the explicit hiding list in the import of + ‘Mod125_A’ (at mod125.hs:4:1-26). diff --git a/testsuite/tests/module/mod126.stderr b/testsuite/tests/module/mod126.stderr index 453cf910a4..cb284c8847 100644 --- a/testsuite/tests/module/mod126.stderr +++ b/testsuite/tests/module/mod126.stderr @@ -2,5 +2,5 @@ mod126.hs:7:5: error: [GHC-88464] Data constructor not in scope: T Suggested fix: - Perhaps you want to remove ‘T’ from the explicit hiding list - in the import of ‘Mod126_A’ (mod126.hs:4:1-26). + Remove ‘T’ from the explicit hiding list in the import of + ‘Mod126_A’ (at mod126.hs:4:1-26). diff --git a/testsuite/tests/module/mod127.stderr b/testsuite/tests/module/mod127.stderr index 1a5c290574..dda3787694 100644 --- a/testsuite/tests/module/mod127.stderr +++ b/testsuite/tests/module/mod127.stderr @@ -2,5 +2,5 @@ mod127.hs:6:6: error: [GHC-76037] Not in scope: type constructor or class ‘T’ Suggested fix: - Perhaps you want to remove ‘T’ from the explicit hiding list - in the import of ‘Mod127_A’ (mod127.hs:4:1-26). + Remove ‘T’ from the explicit hiding list in the import of + ‘Mod127_A’ (at mod127.hs:4:1-26). diff --git a/testsuite/tests/module/mod130.stderr b/testsuite/tests/module/mod130.stderr index 5c5a32095d..f88ee23d8e 100644 --- a/testsuite/tests/module/mod130.stderr +++ b/testsuite/tests/module/mod130.stderr @@ -2,5 +2,5 @@ mod130.hs:7:5: error: [GHC-88464] Variable not in scope: (<) :: t0 -> Int -> Int Suggested fix: - Perhaps you want to remove ‘<’ from the explicit hiding list - in the import of ‘Prelude’ (mod130.hs:4:1-33). + Remove ‘<’ from the explicit hiding list in the import of ‘Prelude’ + (at mod130.hs:4:1-33). diff --git a/testsuite/tests/module/mod134.stderr b/testsuite/tests/module/mod134.stderr index d9afe11866..884a935c65 100644 --- a/testsuite/tests/module/mod134.stderr +++ b/testsuite/tests/module/mod134.stderr @@ -6,5 +6,5 @@ mod134.hs:6:19: error: [GHC-76037] ‘Prelude.read’ (imported from Prelude), ‘Prelude.reads’ (imported from Prelude), ‘Prelude.id’ (imported from Prelude) - • Perhaps you want to remove ‘head’ from the explicit hiding list - in the import of ‘Prelude’ (mod134.hs:4:1-28). + • Remove ‘head’ from the explicit hiding list in the import of + ‘Prelude’ (at mod134.hs:4:1-28). diff --git a/testsuite/tests/module/mod29.stderr b/testsuite/tests/module/mod29.stderr index b7989606a8..33ba714d4d 100644 --- a/testsuite/tests/module/mod29.stderr +++ b/testsuite/tests/module/mod29.stderr @@ -2,5 +2,5 @@ mod29.hs:6:12: error: [GHC-76037] Not in scope: type constructor or class ‘Char’ Suggested fix: - Perhaps you want to add ‘Char’ to the import list in the import of - ‘Prelude’ (mod29.hs:5:1-19). + Add ‘Char’ to the import list in the import of ‘Prelude’ + (at mod29.hs:5:1-19). diff --git a/testsuite/tests/module/mod36.stderr b/testsuite/tests/module/mod36.stderr index 090082a0a2..d7f7ed85b9 100644 --- a/testsuite/tests/module/mod36.stderr +++ b/testsuite/tests/module/mod36.stderr @@ -2,5 +2,5 @@ mod36.hs:5:5: error: [GHC-88464] Variable not in scope: const Suggested fix: - Perhaps you want to remove ‘const’ from the explicit hiding list - in the import of ‘Prelude’ (mod36.hs:3:1-32). + Remove ‘const’ from the explicit hiding list in the import of + ‘Prelude’ (at mod36.hs:3:1-32). diff --git a/testsuite/tests/module/mod79.stderr b/testsuite/tests/module/mod79.stderr index 16cdda2c57..0572188a5a 100644 --- a/testsuite/tests/module/mod79.stderr +++ b/testsuite/tests/module/mod79.stderr @@ -1,2 +1,3 @@ -mod79.hs:3:16: Module ‘Prelude’ does not export ‘C’ +mod79.hs:3:16: error: [GHC-61689] + Module ‘Prelude’ does not export ‘C’. diff --git a/testsuite/tests/module/mod80.stderr b/testsuite/tests/module/mod80.stderr index fa4131e86b..2e075d1500 100644 --- a/testsuite/tests/module/mod80.stderr +++ b/testsuite/tests/module/mod80.stderr @@ -1,2 +1,3 @@ -mod80.hs:3:16: Module ‘Prelude’ does not export ‘f’ +mod80.hs:3:16: error: [GHC-61689] + Module ‘Prelude’ does not export ‘f’. diff --git a/testsuite/tests/module/mod81.stderr b/testsuite/tests/module/mod81.stderr index 0c07e6dfaa..8b024c98d9 100644 --- a/testsuite/tests/module/mod81.stderr +++ b/testsuite/tests/module/mod81.stderr @@ -1,3 +1,5 @@ -mod81.hs:3:16: error: - Module ‘Prelude’ does not export ‘Either(Foo)’ +mod81.hs:3:16: error: [GHC-10237] + In the import of ‘Prelude’: + an item called ‘Either’ is exported, but it does not export any children + (constructors, class methods or field names) called ‘Foo’. diff --git a/testsuite/tests/module/mod87.stderr b/testsuite/tests/module/mod87.stderr index 0090030078..16a833b705 100644 --- a/testsuite/tests/module/mod87.stderr +++ b/testsuite/tests/module/mod87.stderr @@ -2,5 +2,5 @@ mod87.hs:4:5: error: [GHC-88464] Data constructor not in scope: Left :: GHC.Types.Char -> t Suggested fix: - Perhaps you want to add ‘Left’ to the import list in the import of - ‘Prelude’ (mod87.hs:3:1-22). + Add ‘Left’ to the import list in the import of ‘Prelude’ + (at mod87.hs:3:1-22). diff --git a/testsuite/tests/module/mod88.stderr b/testsuite/tests/module/mod88.stderr index 81c758f8b0..8d6ae082d3 100644 --- a/testsuite/tests/module/mod88.stderr +++ b/testsuite/tests/module/mod88.stderr @@ -2,5 +2,5 @@ mod88.hs:5:5: error: [GHC-76037] Not in scope: data constructor ‘Prelude.Left’ Suggested fix: - Perhaps you want to add ‘Left’ to the import list in the import of - ‘Prelude’ (mod88.hs:4:1-30). + Add ‘Left’ to the import list in the import of ‘Prelude’ + (at mod88.hs:4:1-30). diff --git a/testsuite/tests/module/mod90.stderr b/testsuite/tests/module/mod90.stderr index 78a0040303..5e746f8ef2 100644 --- a/testsuite/tests/module/mod90.stderr +++ b/testsuite/tests/module/mod90.stderr @@ -1,8 +1,11 @@ -mod90.hs:3:16: error: - In module ‘Prelude’: - ‘Left’ is a data constructor of ‘Either’ - To import it use - import Prelude( Either( Left ) ) - or - import Prelude( Either(..) ) +mod90.hs:3:16: error: [GHC-35373] + In the import of ‘Prelude’: + an item called ‘Left’ + is exported, but it is a data constructor of + ‘Either’. + Suggested fix: + Use + import Prelude ( Either( Left ) ) + or + import Prelude ( Either(..) ) diff --git a/testsuite/tests/module/mod91.stderr b/testsuite/tests/module/mod91.stderr index 6b0a9cc737..b306af212d 100644 --- a/testsuite/tests/module/mod91.stderr +++ b/testsuite/tests/module/mod91.stderr @@ -1,2 +1,5 @@ -mod91.hs:3:16: error: Module ‘Prelude’ does not export ‘Eq(eq)’ +mod91.hs:3:16: error: [GHC-10237] + In the import of ‘Prelude’: + an item called ‘Eq’ is exported, but it does not export any children + (constructors, class methods or field names) called ‘eq’. diff --git a/testsuite/tests/module/mod97.stderr b/testsuite/tests/module/mod97.stderr index 2b6d5258d0..80b17622b6 100644 --- a/testsuite/tests/module/mod97.stderr +++ b/testsuite/tests/module/mod97.stderr @@ -3,5 +3,5 @@ mod97.hs:4:9: error: [GHC-88464] Variable not in scope: (==) :: GHC.Types.Char -> GHC.Types.Char -> t Suggested fix: - Perhaps you want to add ‘==’ to the import list in the import of - ‘Prelude’ (mod97.hs:3:1-18). + Add ‘==’ to the import list in the import of ‘Prelude’ + (at mod97.hs:3:1-18). diff --git a/testsuite/tests/parser/should_fail/T17045.stderr b/testsuite/tests/parser/should_fail/T17045.stderr index f4bf96c8be..e24aa10802 100644 --- a/testsuite/tests/parser/should_fail/T17045.stderr +++ b/testsuite/tests/parser/should_fail/T17045.stderr @@ -2,5 +2,5 @@ T17045.hs:7:11: error: [GHC-76037] Not in scope: type constructor or class ‘String’ Suggested fix: - Perhaps you want to add ‘String’ to the import list - in the import of ‘Prelude’ (T17045.hs:5:1-27). + Add ‘String’ to the import list in the import of ‘Prelude’ + (at T17045.hs:5:1-27). diff --git a/testsuite/tests/qualifieddo/should_fail/qdofail003.stderr b/testsuite/tests/qualifieddo/should_fail/qdofail003.stderr index bd34088a51..6b21aee631 100644 --- a/testsuite/tests/qualifieddo/should_fail/qdofail003.stderr +++ b/testsuite/tests/qualifieddo/should_fail/qdofail003.stderr @@ -2,5 +2,5 @@ qdofail003.hs:11:5: error: [GHC-76037] Not in scope: ‘P.>>’ Suggested fix: - Perhaps you want to remove ‘>>’ from the explicit hiding list - in the import of ‘Prelude’ (qdofail003.hs:3:1-33). + Remove ‘>>’ from the explicit hiding list in the import of + ‘Prelude’ (at qdofail003.hs:3:1-33). diff --git a/testsuite/tests/qualifieddo/should_fail/qdofail004.stderr b/testsuite/tests/qualifieddo/should_fail/qdofail004.stderr index 6bfb5daeb4..5297fb09cb 100644 --- a/testsuite/tests/qualifieddo/should_fail/qdofail004.stderr +++ b/testsuite/tests/qualifieddo/should_fail/qdofail004.stderr @@ -2,5 +2,5 @@ qdofail004.hs:10:5: error: [GHC-76037] Not in scope: ‘P.fail’ Suggested fix: - Perhaps you want to remove ‘fail’ from the explicit hiding list - in the import of ‘Prelude’ (qdofail004.hs:3:1-33). + Remove ‘fail’ from the explicit hiding list in the import of + ‘Prelude’ (at qdofail004.hs:3:1-33). diff --git a/testsuite/tests/rename/prog002/rename.prog002.stderr b/testsuite/tests/rename/prog002/rename.prog002.stderr index ed70237ce5..7b16027a19 100644 --- a/testsuite/tests/rename/prog002/rename.prog002.stderr +++ b/testsuite/tests/rename/prog002/rename.prog002.stderr @@ -2,5 +2,5 @@ rnfail037.hs:8:7: error: [GHC-76037] Not in scope: data constructor ‘Rn037Help.C’ Suggested fix: - Perhaps you want to remove ‘C’ from the explicit hiding list - in the import of ‘Rn037Help’ (rnfail037.hs:4:1-28). + Remove ‘C’ from the explicit hiding list in the import of + ‘Rn037Help’ (at rnfail037.hs:4:1-28). diff --git a/testsuite/tests/rename/should_compile/T1789.stderr b/testsuite/tests/rename/should_compile/T1789.stderr index d15f0044a2..9941f21ec6 100644 --- a/testsuite/tests/rename/should_compile/T1789.stderr +++ b/testsuite/tests/rename/should_compile/T1789.stderr @@ -5,7 +5,7 @@ T1789.hs:6:1: warning: [-Wmissing-import-lists] T1789.hs:7:1: warning: [-Wmissing-import-lists] The module ‘Data.Map’ does not have an explicit import list -T1789.hs:9:1: warning: [GHC-77037] [-Wmissing-import-lists] +T1789.hs:9:20: warning: [GHC-77037] [-Wmissing-import-lists] The import item ‘Maybe(..)’ does not have an explicit import list T1789.hs:10:1: warning: [-Wmissing-import-lists] diff --git a/testsuite/tests/rename/should_compile/T4489.stderr b/testsuite/tests/rename/should_compile/T4489.stderr index 7e1bfbac38..b4ad5cd093 100644 --- a/testsuite/tests/rename/should_compile/T4489.stderr +++ b/testsuite/tests/rename/should_compile/T4489.stderr @@ -2,5 +2,5 @@ T4489.hs:4:1: warning: [-Wmissing-import-lists] The module ‘Data.Maybe’ does not have an explicit import list -T4489.hs:5:1: warning: [GHC-77037] [-Wmissing-import-lists] +T4489.hs:5:20: warning: [GHC-77037] [-Wmissing-import-lists] The import item ‘Maybe(..)’ does not have an explicit import list diff --git a/testsuite/tests/rename/should_compile/T7167.stderr b/testsuite/tests/rename/should_compile/T7167.stderr index 4da1c5283e..3d5943c997 100644 --- a/testsuite/tests/rename/should_compile/T7167.stderr +++ b/testsuite/tests/rename/should_compile/T7167.stderr @@ -1,3 +1,3 @@ -T7167.hs:6:1: warning: [-Wdodgy-imports (in -Wextra)] - Module ‘Data.List’ does not export ‘foo’ +T7167.hs:6:26: warning: [GHC-61689] [-Wdodgy-imports (in -Wextra)] + Module ‘Data.List’ does not export ‘foo’. diff --git a/testsuite/tests/rename/should_fail/T10668.stderr b/testsuite/tests/rename/should_fail/T10668.stderr index 4e602b28b4..48d314719b 100644 --- a/testsuite/tests/rename/should_fail/T10668.stderr +++ b/testsuite/tests/rename/should_fail/T10668.stderr @@ -1,8 +1,11 @@ -T10668.hs:3:27: error: - In module ‘Data.Type.Equality’: - ‘Refl’ is a data constructor of ‘(:~:)’ - To import it use - import Data.Type.Equality( (:~:)( Refl ) ) - or - import Data.Type.Equality( (:~:)(..) ) +T10668.hs:3:27: error: [GHC-35373] + In the import of ‘Data.Type.Equality’: + an item called ‘Refl’ + is exported, but it is a data constructor of + ‘(:~:)’. + Suggested fix: + Use + import Data.Type.Equality ( (:~:)( Refl ) ) + or + import Data.Type.Equality ( (:~:)(..) ) diff --git a/testsuite/tests/rename/should_fail/T11071.stderr b/testsuite/tests/rename/should_fail/T11071.stderr index ceb215ddb6..efe9501a95 100644 --- a/testsuite/tests/rename/should_fail/T11071.stderr +++ b/testsuite/tests/rename/should_fail/T11071.stderr @@ -19,22 +19,22 @@ T11071.hs:22:12: error: [GHC-76037] T11071.hs:23:12: error: [GHC-76037] Not in scope: ‘Data.List.sort’ Suggested fix: - Perhaps you want to add ‘sort’ to the import list in the import of - ‘Data.List’ (T11071.hs:3:1-24). + Add ‘sort’ to the import list in the import of ‘Data.List’ + (at T11071.hs:3:1-24). T11071.hs:24:12: error: [GHC-76037] Not in scope: ‘Data.List.unlines’ Suggested fixes: • Perhaps use ‘Data.List.lines’ (imported from Data.List) - • Perhaps you want to add ‘unlines’ to the import list - in the import of ‘Data.List’ (T11071.hs:3:1-24). + • Add ‘unlines’ to the import list in the import of ‘Data.List’ + (at T11071.hs:3:1-24). T11071.hs:25:12: error: [GHC-76037] Not in scope: ‘M.size’ Suggested fix: - Perhaps you want to add ‘size’ to one of these import lists: - ‘Data.IntMap’ (T11071.hs:5:1-36) - ‘Data.Map’ (T11071.hs:4:1-33) + Add ‘size’ to one of these import lists: + ‘Data.IntMap’ (at T11071.hs:5:1-36) + ‘Data.Map’ (at T11071.hs:4:1-33) T11071.hs:26:12: error: [GHC-76037] Not in scope: ‘M.valid’ @@ -42,19 +42,18 @@ T11071.hs:26:12: error: [GHC-76037] • Perhaps use one of these: ‘M'.valid’ (imported from Data.Map), ‘M'.valid’ (imported from Data.Map) - • Perhaps you want to add ‘valid’ to the import list - in the import of ‘Data.Map’ (T11071.hs:4:1-33). + • Add ‘valid’ to the import list in the import of ‘Data.Map’ + (at T11071.hs:4:1-33). T11071.hs:27:12: error: [GHC-76037] Not in scope: data constructor ‘Ord.Down’ Suggested fix: - Perhaps you want to remove ‘Down’ from the explicit hiding list - in the import of ‘Data.Ord’ (T11071.hs:8:1-46). + Remove ‘Down’ from the explicit hiding list in the import of + ‘Data.Ord’ (at T11071.hs:8:1-46). T11071.hs:28:12: error: [GHC-76037] Not in scope: ‘M'.size’ Suggested fix: - Perhaps you want to remove ‘size’ from the hiding clauses - in one of these imports: - ‘Data.IntMap’ (T11071.hs:12:1-48) - ‘Data.Map’ (T11071.hs:10:1-53) + Remove ‘size’ from the hiding clauses in one of these imports: + ‘Data.IntMap’ (at T11071.hs:12:1-48) + ‘Data.Map’ (at T11071.hs:10:1-53) diff --git a/testsuite/tests/rename/should_fail/T11071a.stderr b/testsuite/tests/rename/should_fail/T11071a.stderr index 6ab683b74b..631dd7291e 100644 --- a/testsuite/tests/rename/should_fail/T11071a.stderr +++ b/testsuite/tests/rename/should_fail/T11071a.stderr @@ -2,8 +2,8 @@ T11071a.hs:12:12: error: [GHC-88464] Variable not in scope: intersperse Suggested fix: - Perhaps you want to add ‘intersperse’ to the import list - in the import of ‘Data.List’ (T11071a.hs:3:1-24). + Add ‘intersperse’ to the import list in the import of ‘Data.List’ + (at T11071a.hs:3:1-24). T11071a.hs:13:12: error: [GHC-88464] Variable not in scope: foldl' @@ -11,20 +11,20 @@ T11071a.hs:13:12: error: [GHC-88464] • Perhaps use one of these: ‘foldl’ (imported from Prelude), ‘foldl1’ (imported from Prelude), ‘foldr’ (imported from Prelude) - • Perhaps you want to add ‘foldl'’ to one of these import lists: - ‘Data.List’ (T11071a.hs:3:1-24) - ‘Data.IntMap’ (T11071a.hs:4:1-21) + • Add ‘foldl'’ to one of these import lists: + ‘Data.List’ (at T11071a.hs:3:1-24) + ‘Data.IntMap’ (at T11071a.hs:4:1-21) T11071a.hs:14:12: error: [GHC-88464] Data constructor not in scope: Down Suggested fix: - Perhaps you want to remove ‘Down’ from the explicit hiding list - in the import of ‘Data.Ord’ (T11071a.hs:5:1-29). + Remove ‘Down’ from the explicit hiding list in the import of + ‘Data.Ord’ (at T11071a.hs:5:1-29). T11071a.hs:15:12: error: [GHC-88464] Data constructor not in scope: True Suggested fix: - Perhaps you want to remove ‘True’ from the explicit hiding list - in the import of ‘Prelude’ (T11071a.hs:6:1-28). + Remove ‘True’ from the explicit hiding list in the import of + ‘Prelude’ (at T11071a.hs:6:1-28). T11071a.hs:16:12: error: [GHC-88464] Variable not in scope: foobar diff --git a/testsuite/tests/rename/should_fail/T15607.stderr b/testsuite/tests/rename/should_fail/T15607.stderr index b6bfed5e29..63d2f67e72 100644 --- a/testsuite/tests/rename/should_fail/T15607.stderr +++ b/testsuite/tests/rename/should_fail/T15607.stderr @@ -2,5 +2,5 @@ T15607.hs:6:10: error: [GHC-88464] Variable not in scope: pure :: t0 -> t Suggested fix: - Perhaps you want to remove ‘pure’ from the explicit hiding list - in the import of ‘Prelude’ (T15607.hs:4:1-36). + Remove ‘pure’ from the explicit hiding list in the import of + ‘Prelude’ (at T15607.hs:4:1-36). diff --git a/testsuite/tests/rename/should_fail/T19843h.stderr b/testsuite/tests/rename/should_fail/T19843h.stderr index 55d3fcdd96..a47a9fb92f 100644 --- a/testsuite/tests/rename/should_fail/T19843h.stderr +++ b/testsuite/tests/rename/should_fail/T19843h.stderr @@ -28,7 +28,7 @@ T19843h.hs:24:8: error: [GHC-39999] • No instance for ‘GHC.Records.HasField "getAll" r0 a0’ arising from selecting the field ‘getAll’ Perhaps use record field of Alt ‘getAlt’ (imported from Data.Monoid) - Perhaps you want to add ‘getAll’ to the import list - in the import of ‘Data.Monoid’ (T19843h.hs:9:1-28). + Add ‘getAll’ to the import list in the import of ‘Data.Monoid’ + (at T19843h.hs:9:1-28). • In the expression: undefined.getAll In an equation for ‘quur’: quur = undefined.getAll diff --git a/testsuite/tests/rename/should_fail/T19843i.stderr b/testsuite/tests/rename/should_fail/T19843i.stderr index d55bb16d66..178151fb6a 100644 --- a/testsuite/tests/rename/should_fail/T19843i.stderr +++ b/testsuite/tests/rename/should_fail/T19843i.stderr @@ -2,5 +2,5 @@ T19843i.hs:5:5: error: [GHC-76037] Not in scope: ‘M.getSum’ Suggested fix: - Perhaps you want to add ‘getSum’ to the import list - in the import of ‘Data.Monoid’ (T19843i.hs:3:1-32). + Add ‘getSum’ to the import list in the import of ‘Data.Monoid’ + (at T19843i.hs:3:1-32). diff --git a/testsuite/tests/rename/should_fail/T19843j.stderr b/testsuite/tests/rename/should_fail/T19843j.stderr index c7aa7058b9..114a607508 100644 --- a/testsuite/tests/rename/should_fail/T19843j.stderr +++ b/testsuite/tests/rename/should_fail/T19843j.stderr @@ -2,5 +2,5 @@ T19843j.hs:5:5: error: [GHC-88464] Variable not in scope: guard Suggested fix: - Perhaps you want to add ‘guard’ to the import list in the import of - ‘Control.Monad’ (T19843j.hs:3:1-31). + Add ‘guard’ to the import list in the import of ‘Control.Monad’ + (at T19843j.hs:3:1-31). diff --git a/testsuite/tests/rename/should_fail/T5385.stderr b/testsuite/tests/rename/should_fail/T5385.stderr index dd825c6119..2cad188185 100644 --- a/testsuite/tests/rename/should_fail/T5385.stderr +++ b/testsuite/tests/rename/should_fail/T5385.stderr @@ -1,8 +1,11 @@ -T5385.hs:3:16: error: - In module ‘T5385a’: - ‘(:::)’ is a data constructor of ‘T’ - To import it use - import T5385a( T( (:::) ) ) - or - import T5385a( T(..) ) +T5385.hs:3:16: error: [GHC-35373] + In the import of ‘T5385a’: + an item called ‘(:::)’ + is exported, but it is a data constructor of + ‘T’. + Suggested fix: + Use + import T5385a ( T( (:::) ) ) + or + import T5385a ( T(..) ) diff --git a/testsuite/tests/rename/should_fail/T9006.stderr b/testsuite/tests/rename/should_fail/T9006.stderr index dc82687453..4648a99ca9 100644 --- a/testsuite/tests/rename/should_fail/T9006.stderr +++ b/testsuite/tests/rename/should_fail/T9006.stderr @@ -1,2 +1,5 @@ -T9006.hs:3:16: Module ‘T9006a’ does not export ‘T(T)’ +T9006.hs:3:16: error: [GHC-10237] + In the import of ‘T9006a’: + an item called ‘T’ is exported, but it does not export any children + (constructors, class methods or field names) called ‘T’. diff --git a/testsuite/tests/rename/should_fail/rnfail030.stderr b/testsuite/tests/rename/should_fail/rnfail030.stderr index 705ea7fba2..a95501077d 100644 --- a/testsuite/tests/rename/should_fail/rnfail030.stderr +++ b/testsuite/tests/rename/should_fail/rnfail030.stderr @@ -2,5 +2,5 @@ rnfail030.hs:2:21: error: [GHC-76037] Not in scope: ‘Data.List.map’ Suggested fix: - Perhaps you want to add ‘map’ to the import list in the import of - ‘Data.List’ (rnfail030.hs:3:1-19). + Add ‘map’ to the import list in the import of ‘Data.List’ + (at rnfail030.hs:3:1-19). diff --git a/testsuite/tests/rename/should_fail/rnfail031.stderr b/testsuite/tests/rename/should_fail/rnfail031.stderr index 1f6d57d7a8..f947ecf15b 100644 --- a/testsuite/tests/rename/should_fail/rnfail031.stderr +++ b/testsuite/tests/rename/should_fail/rnfail031.stderr @@ -2,5 +2,5 @@ rnfail031.hs:2:21: error: [GHC-76037] Not in scope: ‘Data.List.map’ Suggested fix: - Perhaps you want to add ‘map’ to the import list in the import of - ‘Data.List’ (rnfail031.hs:3:1-36). + Add ‘map’ to the import list in the import of ‘Data.List’ + (at rnfail031.hs:3:1-36). diff --git a/testsuite/tests/rename/should_fail/rnfail032.stderr b/testsuite/tests/rename/should_fail/rnfail032.stderr index f05e4bc623..729f7722d4 100644 --- a/testsuite/tests/rename/should_fail/rnfail032.stderr +++ b/testsuite/tests/rename/should_fail/rnfail032.stderr @@ -6,5 +6,5 @@ rnfail032.hs:2:21: error: [GHC-76037] ‘Data.List.zip’ (imported from Data.List), ‘Data.List.or’ (imported from Data.List), ‘Data.List.all’ (imported from Data.List) - • Perhaps you want to remove ‘map’ from the explicit hiding list - in the import of ‘Data.List’ (rnfail032.hs:3:1-41). + • Remove ‘map’ from the explicit hiding list in the import of + ‘Data.List’ (at rnfail032.hs:3:1-41). diff --git a/testsuite/tests/rename/should_fail/rnfail033.stderr b/testsuite/tests/rename/should_fail/rnfail033.stderr index f16eb4ca2b..cacffa02b3 100644 --- a/testsuite/tests/rename/should_fail/rnfail033.stderr +++ b/testsuite/tests/rename/should_fail/rnfail033.stderr @@ -6,5 +6,5 @@ rnfail033.hs:2:21: error: [GHC-76037] ‘Data.List.zip’ (imported from Data.List), ‘Data.List.or’ (imported from Data.List), ‘Data.List.all’ (imported from Data.List) - • Perhaps you want to remove ‘map’ from the explicit hiding list - in the import of ‘Data.List’ (rnfail033.hs:3:1-31). + • Remove ‘map’ from the explicit hiding list in the import of + ‘Data.List’ (at rnfail033.hs:3:1-31). diff --git a/testsuite/tests/th/T18102.stderr b/testsuite/tests/th/T18102.stderr index f8ec2715d2..be9a1f839d 100644 --- a/testsuite/tests/th/T18102.stderr +++ b/testsuite/tests/th/T18102.stderr @@ -15,8 +15,8 @@ T18102.hs:11:35: error: [GHC-76037] $$(do _stuff <- [|| if True then 10 else 15 ||] return []) Suggested fix: - Perhaps you want to add ‘fromInteger’ to the import list - in the import of ‘Prelude’ (T18102.hs:5:1-50). + Add ‘fromInteger’ to the import list in the import of ‘Prelude’ + (at T18102.hs:5:1-50). T18102.hs:11:43: error: [GHC-76037] • Not in scope: ‘fromInteger’ @@ -26,5 +26,5 @@ T18102.hs:11:43: error: [GHC-76037] $$(do _stuff <- [|| if True then 10 else 15 ||] return []) Suggested fix: - Perhaps you want to add ‘fromInteger’ to the import list - in the import of ‘Prelude’ (T18102.hs:5:1-50). + Add ‘fromInteger’ to the import list in the import of ‘Prelude’ + (at T18102.hs:5:1-50). diff --git a/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr index 4ef63821ca..bc64b6559c 100644 --- a/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr @@ -7,9 +7,8 @@ valid_hole_fits.hs:9:6: warning: [GHC-88464] [-Wdeferred-out-of-scope-variables • Perhaps use one of these: ‘System.IO.putStrLn’ (imported from System.IO), ‘System.IO.putStr’ (imported from System.IO) - • Perhaps you want to remove ‘putStrLn’ - from the explicit hiding list in the import of ‘Prelude’ - (valid_hole_fits.hs:3:1-40). + • Remove ‘putStrLn’ from the explicit hiding list in the import of + ‘Prelude’ (at valid_hole_fits.hs:3:1-40). valid_hole_fits.hs:17:17: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] • Found hole: _ :: Int -> IO Int diff --git a/testsuite/tests/typecheck/should_fail/T13640.stderr b/testsuite/tests/typecheck/should_fail/T13640.stderr index 7c4a944b17..c226b87bda 100644 --- a/testsuite/tests/typecheck/should_fail/T13640.stderr +++ b/testsuite/tests/typecheck/should_fail/T13640.stderr @@ -5,5 +5,5 @@ T13640.hs:13:22: error: [GHC-88464] :: (f0 a c0 -> f0 b c0) -> ((a0 -> b0) -> f1 a0 -> f1 b0) -> f a c -> f b d Suggested fix: - Perhaps you want to remove ‘.’ from the explicit hiding list - in the import of ‘Prelude’ (T13640.hs:4:1-27). + Remove ‘.’ from the explicit hiding list in the import of ‘Prelude’ + (at T13640.hs:4:1-27). |