git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Use (..) for data constructors in suggestion
4569aa4Gary Burgess
src/Language/PureScript/Linter/Imports.hs+9−1
@@ -213,7 +213,15 @@ lintImportDecl env mni qualifierName names declType allowImplicit =
213 checkImplicit warning =
213 checkImplicit warning =
214 if null allRefs
214 if null allRefs
215 then unused
215 then unused
216− else warn (warning mni allRefs)
216+ else warn (warning mni (map simplifyTypeRef allRefs))
217+ where
218+ -- Replace explicit type refs with data constructor lists from listing the
219+ -- used constructors explicity `T(X, Y, [...])` to `T(..)` for suggestion
220+ -- message.
221+ simplifyTypeRef :: DeclarationRef -> DeclarationRef
222+ simplifyTypeRef (TypeRef name (Just dctors))
223+ | not (null dctors) = TypeRef name Nothing
224+ simplifyTypeRef other = other
217
225
218 checkExplicit
226 checkExplicit
219 :: [DeclarationRef]
227 :: [DeclarationRef]