File tree 2 files changed +24
-5
lines changed
2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change 1191
1191
(eq? (caadar binds) 'tuple ))
1192
1192
(let ((vars (lhs-vars (cadar binds))))
1193
1193
(loop (cdr binds)
1194
- `(scope-block
1195
- (block
1196
- ,@(map (lambda (v ) `(local-def ,v)) vars)
1197
- ,(car binds)
1198
- ,blk)))))
1194
+ (if (expr-contains-p (lambda (x ) (memq x vars)) (caddr (car binds)))
1195
+ ; ; use more careful lowering if there are name conflicts. issue #25652
1196
+ (let ((temp (make-ssavalue)))
1197
+ `(block
1198
+ (= ,temp ,(caddr (car binds)))
1199
+ (scope-block
1200
+ (block
1201
+ ,@(map (lambda (v ) `(local-def ,v)) vars)
1202
+ (= ,(cadr (car binds)) ,temp)
1203
+ ,blk))))
1204
+ `(scope-block
1205
+ (block
1206
+ ,@(map (lambda (v ) `(local-def ,v)) vars)
1207
+ ,(car binds)
1208
+ ,blk))))))
1199
1209
(else (error " invalid let syntax" ))))
1200
1210
(else (error " invalid let syntax" )))))))))
1201
1211
Original file line number Diff line number Diff line change @@ -3939,6 +3939,15 @@ let ex = quote
3939
3939
@test ex. args[2 ] == :test
3940
3940
end
3941
3941
3942
+ # issue #25652
3943
+ x25652 = 1
3944
+ x25652_2 = let (x25652, _) = (x25652, nothing )
3945
+ x25652 = x25652 + 1
3946
+ x25652
3947
+ end
3948
+ @test x25652_2 == 2
3949
+ @test x25652 == 1
3950
+
3942
3951
# issue #15180
3943
3952
function f15180 (x:: T ) where T
3944
3953
X = Vector {T} (uninitialized, 1 )
You can’t perform that action at this time.
0 commit comments