git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix spurious import suggestions when re-exporting
c5d0584Gary Burgess
src/Language/PureScript/Linter/Imports.hs+9−4
@@ -162,10 +162,15 @@ lintImports (Module _ _ mn mdecls mexports) env usedImps = do
162 -> [(ModuleName, Name)]
162 -> [(ModuleName, Name)]
163 extractByQual k m toName = mapMaybe go (M.toList m)
163 extractByQual k m toName = mapMaybe go (M.toList m)
164 where
164 where
165− go (q@(Qualified mnq _), is) | isUnqualified q || isQualifiedWith k q =
165+ go (q@(Qualified mnq _), is)
166+ | isUnqualified q =
167+ case find (isQualifiedWith k) (map importName is) of
168+ Just (Qualified _ name) -> Just (k, toName $ Qualified mnq name)
169+ _ -> Nothing
170+ | isQualifiedWith k q =
166− case importName (head is) of
171+ case importName (head is) of
167− Qualified (Just mn') name -> Just (mn', toName $ Qualified mnq name)
172+ Qualified (Just mn') name -> Just (mn', toName $ Qualified mnq name)
168− _ -> internalError "unqualified name in extractByQual"
173+ _ -> internalError "unqualified name in extractByQual"
169 go _ = Nothing
174 go _ = Nothing
170
175
171lintImportDecl
176lintImportDecl