Inline an uncurry

This commit is contained in:
Joseph C. Sible 2020-02-09 20:51:41 -05:00
parent a6efd02807
commit c290eace54
1 changed files with 2 additions and 2 deletions

View File

@ -2223,14 +2223,14 @@ checkUnassignedReferences' includeGlobals params t = warnings
match <- getBestMatch var
return $ " (did you mean '" ++ match ++ "'?)"
warningFor var place = do
warningFor (var, place) = do
guard $ isVariableName var
guard . not $ isInArray var place || isGuarded place
(if includeGlobals || isLocal var
then warningForLocals
else warningForGlobals) var place
warnings = execWriter . sequence $ mapMaybe (uncurry warningFor) unassigned
warnings = execWriter . sequence $ mapMaybe warningFor unassigned
-- Due to parsing, foo=( [bar]=baz ) parses 'bar' as a reference even for assoc arrays.
-- Similarly, ${foo[bar baz]} may not be referencing bar/baz. Just skip these.