git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Remove warning about implicitly importing data constructors
9cf8765Gary Burgess
src/Language/PureScript/Errors.hs−7
@@ -139,7 +139,6 @@ data SimpleErrorMessage
139 | IntOutOfRange Integer String Integer Integer
139 | IntOutOfRange Integer String Integer Integer
140 | RedundantEmptyHidingImport ModuleName
140 | RedundantEmptyHidingImport ModuleName
141 | ImplicitImport ModuleName [DeclarationRef]
141 | ImplicitImport ModuleName [DeclarationRef]
142− | ImplicitDctorImport (ProperName 'TypeName) [ProperName 'ConstructorName]
143 | CaseBinderLengthDiffers Int [Binder]
142 | CaseBinderLengthDiffers Int [Binder]
144 deriving (Show)
143 deriving (Show)
145
144
@@ -311,7 +310,6 @@ errorCode em = case unwrapErrorMessage em of
311 IntOutOfRange{} -> "IntOutOfRange"
310 IntOutOfRange{} -> "IntOutOfRange"
312 RedundantEmptyHidingImport{} -> "RedundantEmptyHidingImport"
311 RedundantEmptyHidingImport{} -> "RedundantEmptyHidingImport"
313 ImplicitImport{} -> "ImplicitImport"
312 ImplicitImport{} -> "ImplicitImport"
314− ImplicitDctorImport{} -> "ImplicitDctorImport"
315 CaseBinderLengthDiffers{} -> "CaseBinderLengthDiffers"
313 CaseBinderLengthDiffers{} -> "CaseBinderLengthDiffers"
316
314
317-- |
315-- |
@@ -865,11 +863,6 @@ prettyPrintSingleError full level showWiki e = flip evalState defaultUnknownMap
865 , indent $ line $ "import " ++ runModuleName mn ++ " (" ++ intercalate ", " (map prettyPrintRef refs) ++ ")"
863 , indent $ line $ "import " ++ runModuleName mn ++ " (" ++ intercalate ", " (map prettyPrintRef refs) ++ ")"
866 ]
864 ]
867
865
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−
873 renderSimpleErrorMessage (CaseBinderLengthDiffers l bs) =
866 renderSimpleErrorMessage (CaseBinderLengthDiffers l bs) =
874 paras $ [ line $ "Binder list length differs in case alternative:"
867 paras $ [ line $ "Binder list length differs in case alternative:"
875 , indent $ line $ intercalate ", " $ fmap prettyPrintBinderAtom bs
868 , 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
86 when (runProperName tn `elem` usedNames) $ case (c, usedDctors `intersect` allCtors) of
86 when (runProperName tn `elem` usedNames) $ case (c, usedDctors `intersect` allCtors) of
87 (_, []) | c /= Just [] ->
87 (_, []) | c /= Just [] ->
88 tell $ errorMessage $ UnusedDctorImport tn
88 tell $ errorMessage $ UnusedDctorImport tn
89− (Nothing, usedDctors') ->
90− tell $ errorMessage $ ImplicitDctorImport tn usedDctors'
91 (Just ctors, usedDctors') ->
89 (Just ctors, usedDctors') ->
92 let ddiff = ctors \\ usedDctors'
90 let ddiff = ctors \\ usedDctors'
93 in unless (null ddiff) $ tell $ errorMessage $ UnusedDctorExplicitImport tn ddiff
91 in unless (null ddiff) $ tell $ errorMessage $ UnusedDctorExplicitImport tn ddiff
92+ _ -> return ()
94
93
95 return ()
94 return ()
96
95