Skip to content

Commit aa0e223

Browse files
JeffBezansonKristofferC
authored andcommitted
fix called-argument analysis for calls with splat (#58070)
(cherry picked from commit bbb0582)
1 parent 6728717 commit aa0e223

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/julia-syntax.scm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3461,6 +3461,11 @@
34613461
(let ((vi (get tab (cadr e) #f)))
34623462
(if vi
34633463
(vinfo:set-called! vi #t))
3464+
;; calls f(x...) go through `_apply_iterate`
3465+
(if (and (length> e 3) (equal? (cadr e) '(core _apply_iterate)))
3466+
(let ((vi2 (get tab (cadddr e) #f)))
3467+
(if vi2
3468+
(vinfo:set-called! vi2 #t))))
34643469
;; calls to functions with keyword args have head of `kwcall` first
34653470
(if (and (length> e 3) (equal? (cadr e) '(core kwcall)))
34663471
(let ((vi2 (get tab (cadddr e) #f)))

test/syntax.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3514,6 +3514,8 @@ end
35143514
# issue #45162
35153515
f45162(f) = f(x=1)
35163516
@test first(methods(f45162)).called != 0
3517+
f45162_2(f) = f([]...)
3518+
@test first(methods(f45162_2)).called != 0
35173519

35183520
# issue #45024
35193521
@test_parseerror "const x" "expected assignment after \"const\""

0 commit comments

Comments
 (0)