Revision d215d914ee388efb0737135d81dcc581e0016f8e authored by Keno Fischer on 15 July 2023, 17:01:26 UTC, committed by GitHub on 15 July 2023, 17:01:26 UTC
Fixes the case from #50518, but we actually have two test cases in the tests that also hit this (e.g. this one: ``` f40964(xs::Int...=1; k = 2) = (xs, k) ``` ), but just happened not to hit the bad codegen path. #50556, once merged would have complained on those definitions as well, without this fix.
test_sourcepath.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license
# source path in tasks
path = Base.source_path()::String # this variable is leaked to the source script
@test endswith(path, joinpath("test", "test_sourcepath.jl"))
@test isabspath(path)
@test let ct = current_task()
yieldto(@task yieldto(ct, Base.source_path()))
end === ""
@test let ct = current_task()
yieldto(@task schedule(ct, Base.source_path()))
end === ""
@test let ct = current_task(),
t = @task Base.source_path()
schedule(ct)
yieldto(t)
fetch(t)
end === ""
@test @__FILE__() == path
Computing file changes ...