Skip to content

Commit e9fc37a

Browse files
committed
add test
Backport of #21069. (cherry picked from commit 1594692)
1 parent c250310 commit e9fc37a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/inference.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,18 @@ test_fast_le(a, b) = @fastmath a <= b
376376
@inferred test_fast_ne(1.0, 1.0)
377377
@inferred test_fast_lt(1.0, 1.0)
378378
@inferred test_fast_le(1.0, 1.0)
379+
380+
#issue #21065, elision of _apply when splatted expression is not effect_free
381+
function f21065(x,y)
382+
println("x=$x, y=$y")
383+
return x, y
384+
end
385+
g21065(x,y) = +(f21065(x,y)...)
386+
function test_no_apply(expr::Expr)
387+
return all(test_no_apply, expr.args)
388+
end
389+
function test_no_apply(ref::GlobalRef)
390+
return ref.mod != Core || ref.name !== :_apply
391+
end
392+
test_no_apply(::Any) = true
393+
@test all(test_no_apply, Base.uncompressed_ast(code_typed(g21065, Tuple{Int,Int})[1]))

0 commit comments

Comments
 (0)