Skip to content

Commit eb144ec

Browse files
committed
Merge pull request purescript#1784 from purescript/remove-impl-ctor-warning
Remove warning about implicitly importing data constructors
2 parents bc5f300 + 9cf8765 commit eb144ec

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

src/Language/PureScript/Errors.hs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)