Skip to content

Commit debf467

Browse files
committed
fix lowering bug in let-bound functions
1 parent e22c20c commit debf467

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/julia-syntax.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@
996996
((and (pair? (cadar binds))
997997
(eq? (caadar binds) 'call))
998998
;; f()=c
999-
(let ((asgn (cadr (julia-expand0 (car binds)))))
999+
(let ((asgn (expand-binding-forms (car binds))))
10001000
(loop (cdr binds)
10011001
`(scope-block
10021002
(block

test/arrayops.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,11 @@ end
857857
@test isequal([1,2,3], [a for (a,b) in enumerate(2:4)])
858858
@test isequal([2,3,4], [b for (a,b) in enumerate(2:4)])
859859

860+
# comprehension in let-bound function
861+
let xy = sum([x[i]*y[i] for i=1:length(x)])
862+
@test [1,2] [3,4] == 11
863+
end
864+
860865
@test_throws DomainError (10.^[-1])[1] == 0.1
861866
@test (10.^[-1.])[1] == 0.1
862867

0 commit comments

Comments
 (0)