File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 1406
1406
,@(let loop ((lhs lhss)
1407
1407
(i 1 ))
1408
1408
(if (null? lhs) ' ((null))
1409
- (cons `(= ,(car lhs)
1410
- (call (core getfield) ,t ,i))
1409
+ (cons (if (eventually-call (car lhs))
1410
+ ; ; if this is a function assignment, avoid putting our ssavalue
1411
+ ; ; inside the function and instead create a capture-able variable.
1412
+ ; ; issue #22032
1413
+ (let ((temp (gensy)))
1414
+ `(block
1415
+ (= ,temp (call (core getfield) ,t ,i))
1416
+ (= ,(car lhs) ,temp)))
1417
+ `(= ,(car lhs)
1418
+ (call (core getfield) ,t ,i)))
1411
1419
(loop (cdr lhs)
1412
1420
(+ i 1 )))))
1413
1421
,t)))
Original file line number Diff line number Diff line change 539
539
@test a[2 ](10 ) == 12
540
540
@test a[3 ](10 ) == 13
541
541
542
+ # issue #22032
543
+ let a = [], fs = []
544
+ for f () in 1 : 3
545
+ push! (a, f ())
546
+ push! (fs, f)
547
+ end
548
+ @test a == [1 ,2 ,3 ]
549
+ @test [f () for f in fs] == [1 ,2 ,3 ]
550
+ end
551
+ let t = (22 ,33 )
552
+ (g (), x) = t
553
+ @test g () == 22
554
+ @test x == 33
555
+ end
556
+
542
557
# issue #21900
543
558
f21900_cnt = 0
544
559
function f21900 ()
You can’t perform that action at this time.
0 commit comments