Skip to content

Commit 230eb53

Browse files
committed
Fix lambda bindings
1 parent 76cd822 commit 230eb53

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

parser-typechecker/src/Unison/Typechecker/Context.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,7 @@ synthesizeWanted e
13451345
let it = existential' l B.Blank i
13461346
ot = existential' l B.Blank o
13471347
et = existential' l B.Blank e
1348+
Debug.debugM Debug.Temp "synthesizeWanted:Lam" (arg, anythingToString boundVarAnn, i, e, o)
13481349
appendContext $
13491350
[existential i, existential e, existential o, Ann arg boundVarAnn it]
13501351

unison-cli/src/Unison/LSP/Queries.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ findSmallestEnclosingNode pos term
240240
Term.And l r -> findSmallestEnclosingNode pos l <|> findSmallestEnclosingNode pos r
241241
Term.Or l r -> findSmallestEnclosingNode pos l <|> findSmallestEnclosingNode pos r
242242
Term.Lam a -> findSmallestEnclosingNode pos a
243-
Term.LetRec _isTop xs y -> altSum (findSmallestEnclosingNode pos <$> xs) <|> findSmallestEnclosingNode pos y
244-
Term.Let _isTop a b -> findSmallestEnclosingNode pos a <|> findSmallestEnclosingNode pos b
243+
Term.LetRec _isTop xs y -> findSmallestEnclosingNode pos y <|> altSum (findSmallestEnclosingNode pos <$> xs)
244+
Term.Let _isTop a b -> findSmallestEnclosingNode pos b <|> findSmallestEnclosingNode pos a
245245
Term.Match a cases ->
246246
findSmallestEnclosingNode pos a
247247
<|> altSum (cases <&> \(MatchCase pat grd body) -> ((PatternNode <$> findSmallestEnclosingPattern pos pat) <|> (grd >>= findSmallestEnclosingNode pos) <|> findSmallestEnclosingNode pos body))

0 commit comments

Comments
 (0)