git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Remove warning about implicitly importing data constructors

The warning is obnoxious and does not help with the safety issue the same way implicit module imports does, as per later discussion in #1741

commit9cf87653e91834c61b325865891ab75f203b8b9f authorGary Burgess <gary.burgess@gmail.com> dateSat 2 Jan 2016, 22:39 (11 years ago) parentbc5f300
2 files changed+1−9
src/Language/PureScript/Errors.hs−7 src/Language/PureScript/Linter/Imports.hs+1−2
src/Language/PureScript/Errors.hs−7
@@ -139,7 +139,6 @@ data SimpleErrorMessage
139139 | IntOutOfRange Integer String Integer Integer
140140 | RedundantEmptyHidingImport ModuleName
141141 | ImplicitImport ModuleName [DeclarationRef]
142− | ImplicitDctorImport (ProperName 'TypeName) [ProperName 'ConstructorName]
143142 | CaseBinderLengthDiffers Int [Binder]
144143 deriving (Show)
145144
@@ -311,7 +310,6 @@ errorCode em = case unwrapErrorMessage em of
311310 IntOutOfRange{} -> "IntOutOfRange"
312311 RedundantEmptyHidingImport{} -> "RedundantEmptyHidingImport"
313312 ImplicitImport{} -> "ImplicitImport"
314− ImplicitDctorImport{} -> "ImplicitDctorImport"
315313 CaseBinderLengthDiffers{} -> "CaseBinderLengthDiffers"
316314
317315-- |
@@ -865,11 +863,6 @@ prettyPrintSingleError full level showWiki e = flip evalState defaultUnknownMap
865863 , indent $ line $ "import " ++ runModuleName mn ++ " (" ++ intercalate ", " (map prettyPrintRef refs) ++ ")"
866864 ]
867865
868− renderSimpleErrorMessage (ImplicitDctorImport ty ctors) =
869− paras [ line $ "Import of type " ++ runProperName ty ++ " has unspecified data constructors, consider using the explicit form: "
870− , indent $ line $ runProperName ty ++ " (" ++ intercalate ", " (map runProperName ctors) ++ ")"
871− ]
872−
873866 renderSimpleErrorMessage (CaseBinderLengthDiffers l bs) =
874867 paras $ [ line $ "Binder list length differs in case alternative:"
875868 , indent $ line $ intercalate ", " $ fmap prettyPrintBinderAtom bs
src/Language/PureScript/Linter/Imports.hs+1−2
@@ -86,11 +86,10 @@ findUnusedImports (Module _ _ _ mdecls mexports) env usedImps = do
8686 when (runProperName tn `elem` usedNames) $ case (c, usedDctors `intersect` allCtors) of
8787 (_, []) | c /= Just [] ->
8888 tell $ errorMessage $ UnusedDctorImport tn
89− (Nothing, usedDctors') ->
90− tell $ errorMessage $ ImplicitDctorImport tn usedDctors'
9189 (Just ctors, usedDctors') ->
9290 let ddiff = ctors \\ usedDctors'
9391 in unless (null ddiff) $ tell $ errorMessage $ UnusedDctorExplicitImport tn ddiff
92+ _ -> return ()
9493
9594 return ()
9695