git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix spurious import suggestions when re-exporting
commitc5d0584c8090ebc7d379ca809739f1be21242c94 authorGary Burgess <gary.burgess@gmail.com> dateSat 9 Apr 2016, 02:10 (11 years ago) parented5c26c
1 file changed+9−4
src/Language/PureScript/Linter/Imports.hs+9−4
src/Language/PureScript/Linter/Imports.hs+9−4
@@ -162,10 +162,15 @@ lintImports (Module _ _ mn mdecls mexports) env usedImps = do
162162 -> [(ModuleName, Name)]
163163 extractByQual k m toName = mapMaybe go (M.toList m)
164164 where
165− go (q@(Qualified mnq _), is) | isUnqualified q || isQualifiedWith k q =
166− case importName (head is) of
167− Qualified (Just mn') name -> Just (mn', toName $ Qualified mnq name)
168− _ -> internalError "unqualified name in extractByQual"
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 =
171+ case importName (head is) of
172+ Qualified (Just mn') name -> Just (mn', toName $ Qualified mnq name)
173+ _ -> internalError "unqualified name in extractByQual"
169174 go _ = Nothing
170175
171176lintImportDecl