File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1144
1144
; ; some kind of assignment
1145
1145
(cond
1146
1146
((eventually-call? (cadar binds))
1147
- ; ; f()= c
1147
+ ; ; f() = c
1148
1148
(let ((asgn (butlast (expand-forms (car binds))))
1149
1149
(name (assigned-name (cadar binds))))
1150
1150
(if (not (symbol? name))
1151
1151
(error " invalid let syntax" ))
1152
1152
(loop (cdr binds)
1153
1153
`(scope-block
1154
1154
(block
1155
- (local-def ,name)
1155
+ ,(if (expr-contains-eq name (caddar binds))
1156
+ `(local ,name) ; ; might need a Box for recursive functions
1157
+ `(local-def ,name))
1156
1158
,asgn
1157
1159
,blk)))))
1158
1160
((or (symbol? (cadar binds))
1159
1161
(decl? (cadar binds)))
1160
1162
(let ((vname (decl-var (cadar binds))))
1161
1163
(loop (cdr binds)
1162
- (if (contains (lambda (x ) (eq? x vname))
1163
- (caddar binds))
1164
+ (if (expr-contains-eq vname (caddar binds))
1164
1165
(let ((tmp (make-ssavalue)))
1165
1166
`(scope-block
1166
1167
(block (= ,tmp ,(caddar binds))
Original file line number Diff line number Diff line change @@ -328,6 +328,13 @@ let f = i18408()
328
328
@test_throws UndefRefError f (0 )
329
329
end
330
330
331
+ # issue #23558
332
+ c23558 (n,k) =
333
+ let fact (n) = if (n == 0 ) 1 else n* fact (n- 1 ) end
334
+ fact (n)/ fact (k)/ fact (n- k)
335
+ end
336
+ @test c23558 (10 , 5 ) == 252
337
+
331
338
# variable scope, globals
332
339
glob_x = 23
333
340
function glotest ()
You can’t perform that action at this time.
0 commit comments