git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Don't warn for a single hiding import

Resolves #2017

commit1292c34d9969de8abf7ffec5d2a59dc3a94b7d17 authorGary Burgess <gary.burgess@gmail.com> dateSat 16 Apr 2016, 16:54 (11 years ago) parent83896db
2 files changed+3−3
src/Language/PureScript/Ide/Imports.hs+2−2 src/Language/PureScript/Linter/Imports.hs+1−1
src/Language/PureScript/Ide/Imports.hs+2−2
@@ -76,8 +76,8 @@ compImport (Import n i q) (Import n' i' q')
7676 | compImportType i i' /= EQ = compImportType i i'
7777 -- This means that for a stable sort, the first implicit import will stay
7878 -- the first implicit import
79− | P.isImplicit i && isNothing q = LT
80− | P.isImplicit i && isNothing q' = GT
79+ | not (P.isExplicit i) && isNothing q = LT
80+ | not (P.isExplicit i) && isNothing q' = GT
8181 | otherwise = compare n n'
8282
8383-- | Reads a file and returns the (lines before the imports, the imports, the
src/Language/PureScript/Linter/Imports.hs+1−1
@@ -190,7 +190,7 @@ lintImportDecl env mni qualifierName names declType allowImplicit =
190190 Just q ->
191191 let usedModuleNames = mapMaybe extractQualName names
192192 in unless (q `elem` usedModuleNames) unused
193− Hiding _ -> checkImplicit HidingImport
193+ Hiding _ -> unless allowImplicit (checkImplicit HidingImport)
194194 Explicit [] -> unused
195195 Explicit declrefs -> checkExplicit declrefs
196196