git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #2021 from purescript/2017-supress-single-hiding-warning

Don't warn for a single hiding import

commit1776455650ea1ec5f23f8b5854fe038af86c2d3b authorGary Burgess <gary.burgess@gmail.com> dateSat 16 Apr 2016, 22:13 (11 years ago) parent1fe80a51292c34
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
@@ -195,7 +195,7 @@ lintImportDecl env mni qualifierName names declType allowImplicit =
195195 Just q ->
196196 let usedModuleNames = mapMaybe extractQualName names
197197 in unless (q `elem` usedModuleNames) unused
198− Hiding _ -> checkImplicit HidingImport
198+ Hiding _ -> unless allowImplicit (checkImplicit HidingImport)
199199 Explicit [] -> unused
200200 Explicit declrefs -> checkExplicit declrefs
201201