-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REPL: cannot assign variables whose names match a name exported from Base after any tab autocompletion #30234
Comments
Not just julia> sin = 1
ERROR: cannot assign variable Base.sin from module Main
Stacktrace:
[1] top-level scope at none:0 |
names
(or any other exported from Base) after tab autocompletion
names
(or any other exported from Base) after tab autocompletion
Note that in 0.6 this only threw a warning:
|
Maybe fixed by #29962? |
No, still happens on master. |
Weird: I just stopped and restarted Julia and now can't reproduce this. Freshly built Julia. 💢 Here's the entire session, just in case it helps debug this: _
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.1.0-DEV.790 (2018-12-03)
_/ |\__'_|_|_|\__'_| | Commit a26031e25a (0 days old master)
|__/ |
julia> ones
ones (generic function with 6 methods)
help?> ones
search: ones leading_ones trailing_ones countlines count_ones to_indices RoundNearest
ones([T=Float64,] dims...)
Create an Array, with element type T, of all ones with size specified by dims. See
also: fill, zeros.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> ones(1,2)
1×2 Array{Float64,2}:
1.0 1.0
julia> ones(ComplexF64, 2, 3)
2×3 Array{Complex{Float64},2}:
1.0+0.0im 1.0+0.0im 1.0+0.0im
1.0+0.0im 1.0+0.0im 1.0+0.0im
julia> zeros
zeros (generic function with 6 methods)
help?> ones
search: ones leading_ones trailing_ones countlines count_ones to_indices RoundNearest
ones([T=Float64,] dims...)
Create an Array, with element type T, of all ones with size specified by dims. See
also: fill, zeros.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> ones(1,2)
1×2 Array{Float64,2}:
1.0 1.0
julia> ones(ComplexF64, 2, 3)
2×3 Array{Complex{Float64},2}:
1.0+0.0im 1.0+0.0im 1.0+0.0im
1.0+0.0im 1.0+0.0im 1.0+0.0im
help?> zeros
search: zeros count_zeros set_zero_subnormals get_zero_subnormals leading_zeros
zeros([T=Float64,] dims...)
Create an Array, with element type T, of all zeros with size specified by dims. See
also fill, ones.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> zeros(1)
1-element Array{Float64,1}:
0.0
julia> zeros(Int8, 2, 3)
2×3 Array{Int8,2}:
0 0 0
0 0 0
julia>
julia> module M
let x = 1
f() = x
end
end
Main.M
julia> M.f()
ERROR: UndefVarError: f not defined
Stacktrace:
[1] getproperty(::Module, ::Symbol) at ./sysimg.jl:13
[2] top-level scope at none:0
julia> module M
let x = 1
global f() = x
end
end
julia> module M
let x = 1
global f() = x
end
end
WARNING: replacing module M.
Main.M
julia> M.f()
1
julia> M.x
ERROR: UndefVarError: x not defined
julia> using Dates
julia> 1day
ERROR: MethodError: no method matching *(::Int64, ::typeof(day))
Closest candidates are:
*(::Any, ::Any, ::Any, ::Any...) at operators.jl:502
*(::T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8}, ::T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8}) where T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8} at int.jl:54
*(::Union{Int16, Int32, Int64, Int8}, ::BigInt) at gmp.jl:454
...
Stacktrace:
[1] top-level scope at none:0
julia> 1Day
ERROR: MethodError: no method matching *(::Int64, ::Type{Day})
Closest candidates are:
*(::Any, ::Any, ::Any, ::Any...) at operators.jl:502
*(::T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8}, ::T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8}) where T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8} at int.jl:54
*(::Union{Int16, Int32, Int64, Int8}, ::BigInt) at gmp.jl:454
...
Stacktrace:
[1] top-level scope at none:0
julia> Day(1)
1 day
julia> Date(2014,1,29):Day(1):Date(2014,2,3)
2014-01-29:1 day:2014-02-03
julia> BLAS.gemm!
ERROR: UndefVarError: BLAS not defined
julia> using LinearAlgebra
julia> BLAS
LinearAlgebra.BLAS
julia> BLAS.ge
gemm gemm! gemv gemv! ger!
julia> BLAS.ge
gemm gemm! gemv gemv! ger!
julia> BLAS.gemm!
gemm! (generic function with 4 methods)
help?> BLAS.gemm!
gemm!(tA, tB, alpha, A, B, beta, C)
Update C as alpha*A*B + beta*C or the other three variants according to tA and tB.
Return the updated C.
julia>
julia> f
factorial filesize findmin! float
factorize fill findnext floatmax
false fill! findprev floatmin
falses filter first floor
fd filter! firstdayofmonth flush
fdio finalize firstdayofquarter fma
fetch finalizer firstdayofweek foldl
fieldcount finally firstdayofyear foldr
fieldname findall firstindex for
fieldnames findfirst fld foreach
fieldoffset findlast fld1 frexp
fieldtype findmax fldmod fullname
fieldtypes findmax! fldmod1 function
filemode findmin flipsign functionloc
julia> sin = 1
ERROR: cannot assign variable Base.sin from module Main
Stacktrace:
[1] top-level scope at none:0 |
This seems to reproduce it reliably in a fresh session: julia> using Linear<tab>Algebra
julia> sin = 1
ERROR: cannot assign variable Base.sin from module Main
Stacktrace:
[1] top-level scope at none:0 |
In particular, tab completing names seems to be a red herring—it's neither necessary nor sufficient. |
On a fresh 1.0.2 session, |
That's a different (similar) bug and is already fixed on master. |
If you press tab twice to autocomplete a name, the variable
names
is no longer assignable in global scope.In a new REPL session:
I saw a few related issues (e.g. #23677) but am not sure if they describe the same issue. If they do, feel free to close.
The text was updated successfully, but these errors were encountered: