-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Re-evaluating parameterized type definitions erros #16424
Comments
A little bit of discussion here: https://groups.google.com/forum/?nomobile=true#!topic/julia-users/OM-NJMkkVoY |
I thought this must have been discussed somewhere. |
@vtjnash It seems that this code now fails: _
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.6.0-dev.2778 (2017-02-12 11:20 UTC)
_/ |\__'_|_|_|\__'_| | Commit 71f6bc9 (0 days old master)
|__/ | x86_64-apple-darwin13.4.0
julia> immutable X{T}
a::T
end
julia> immutable X{T}
a::T
end
ERROR: invalid redefinition of constant X Is that a regression? It's a bummer for cstjean/ClobberingReload.jl#1 (comment) cc. @rdeits |
fix #16424, allow redefining a type to an equivalent one
awesome, thanks @JeffBezanson and @cstjean |
Some definitions still cannot be reevaluated: julia> const TupleOf{T} = NTuple{N, T} where {N}
Tuple{Vararg{T,N}} where N where T
julia> const TupleOf{T} = NTuple{N, T} where {N}
ERROR: invalid redefinition of constant TupleOf |
That's not a type definition. |
Then parametric type aliases cannot be reevaluated. MWE: |
We allow re-assigning constants if the new value is identical. We could expand the definition of "identical" for this case. |
Similar to the type-alias case, this type definition cannot be reevaluated: struct GG{T<:(Vector{U} where U <: Integer)} end |
I noticed this inconsistency (both in 0.4 and 0.5):
Would be nice if the second would not error.
The text was updated successfully, but these errors were encountered: