-
Notifications
You must be signed in to change notification settings - Fork 31
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
Foo(Foo()) is a stackoverflow on 0.7 #73
Comments
I cannot reproduce on neither 0.7 nor 1.0:
You have these |
Good catch, it only happens with julia> using Parameters, ShiftedArrays
julia> @with_kw struct Foo
x=1
y=2
end
Foo
julia> Foo(Foo())
ERROR: StackOverflowError:
Stacktrace:
[1] Base.Generator(::getfield(ShiftedArrays, Symbol("##35#36")){Tuple{}}, ::Array{Union{},1}) at ./generator.jl:32
[2] convert(::Type{Array{Union{},1}}, ::Array{Union{},1}) at /home/cst-jean/.julia/packages/ShiftedArrays/psVhR/src/offset.jl:2 |
cc @piever |
Ups, that's bad! I'll make the package type-piracy free and tag a new release soon |
ShiftedArrays "only" pirates |
That's not even type-piracy. Hmm. I'll check tomorrow which version I'm using, I can't seem to reproduce it at home. |
At work, I'm definitely hitting it with the code above using ShiftedArrays. Maybe it's something else that's peculiar to my setup? Can anyone else reproduce? I'm on 0.7, |
I think I see what it is now. It's definitely unexpected and a consequence of my piracy: julia> Array{Union{}} <: AbstractArray{<:ShiftedArray}
true Somehow for Parameters it's important to convert a For the time being you can probably just comment out the incriminated method and I'll fix ShiftedArrays. |
@piever I hit this again today with another of your packages. julia> using ShiftedArrays, InteractBase
julia> InteractBase.textbox()
ERROR: StackOverflowError:
Stacktrace:
[1] Base.Generator(::getfield(ShiftedArrays, Symbol("##35#36")){Tuple{}}, ::Array{Union{},1}) at ./generator.jl:32
[2] convert(::Type{Array{Union{},1}}, ::Array{Union{},1}) at /home/cst-jean/.julia/packages/ShiftedArrays/psVhR/src/offset.jl:2
... (the last 2 lines are repeated 26665 more times)
[53333] Base.Generator{Array{Union{},1},getfield(ShiftedArrays, Symbol("##35#36")){Tuple{}}}(::Function, ::Array{Union{},1}) at ./generator.jl:32 (repeats 2 times) |
But I really do feel like your code is legit. Base should not be converting to |
Thanks for reporting, I too had noticed some issues with InteractBase. As a practical solution, unless there is a confirmation soonish in the other issue that it'll be fixed on the side of Base, I'll remove my convert overload. |
* dont pirate convert * add helper functions * docs * drop shiftedabstractarray and generalize
It worked fine on 0.6
The text was updated successfully, but these errors were encountered: