From 3b9f02fa97ecd118aba0fcedf38815ca0267ac60 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Thu, 14 Jan 2021 17:45:57 -0500 Subject: [PATCH] fix #39259, leave `Main.ARGS` unresolved on startup --- contrib/generate_precompile.jl | 2 +- test/cmdlineargs.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/generate_precompile.jl b/contrib/generate_precompile.jl index 1572e81aa2b75..d17123d70105a 100644 --- a/contrib/generate_precompile.jl +++ b/contrib/generate_precompile.jl @@ -1,6 +1,6 @@ # This file is a part of Julia. License is MIT: https://julialang.org/license -if isempty(ARGS) || ARGS[1] !== "0" +if isempty(Base.ARGS) || Base.ARGS[1] !== "0" Sys.__init_build() # Prevent this from being put into the Main namespace @eval Module() begin diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl index 300883773099b..51051f379f496 100644 --- a/test/cmdlineargs.jl +++ b/test/cmdlineargs.jl @@ -719,3 +719,6 @@ for yn in ("no", "yes") end @test v[2] end + +# issue #39259, shadowing `ARGS` +@test success(`$(Base.julia_cmd()) --startup-file=no -e 'ARGS=1'`)