-
-
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
Type being initiated with field not matching template type, rather being a "DataType" #11777
Comments
Explicitly stating the types doesn't fix the issue either: SpaceOperator{Float64,typeof(C),typeof(m),typeof(sp)}(C,m,sp).op|>typeof #returns DataType, not typeof(C) |
The trigger for the bug may be the following convert code: function Base.convert{BT<:Operator}(::Type{BT},D::ConversionWrapper)
BO=convert(BandedOperator{eltype(BT)},D.op)
ConversionWrapper{typeof(BO),eltype(BT)}(BO)::BT
end For some reason the type statement @code_typed convert(typeof(C),C)
...
end::Union{})))) |
And after changing convert to be function Base.convert{BT<:Operator}(::Type{BT},D::ConversionWrapper)
BO=convert(BandedOperator{eltype(BT)},D.op)
CW=ConversionWrapper{typeof(BO),eltype(BT)}(BO)
CW
end
I get another strange bug:
julia> @code_typed convert(typeof(C),C)
1-element Array{Any,1}:
Error showing value of type Array{Any,1}:
ERROR: type Union has no field mutable
in isbits at reflection.jl:67
in show_delim_array at show.jl:162
in show_vector at show.jl:1281
in show at show.jl:1285
in show_delim_array at show.jl:167
in show_vector at show.jl:1281
in show at show.jl:1285
in show_delim_array at show.jl:167
in show_vector at show.jl:1281
in show at show.jl:1285
in show_unquoted at ./show.jl:724
in show_unquoted_quote_expr at show.jl:444
in showcompact_lim at show.jl:93
in sprint at iostream.jl:205
in alignment at show.jl:924
in alignment at show.jl:956
in print_matrix at show.jl:1031
in print_matrix at show.jl:1023
in anonymous at replutil.jl:23
in with_output_limit at ./show.jl:1231
in writemime at replutil.jl:23
in display at REPL.jl:113
in display at REPL.jl:116
in display at multimedia.jl:151
in print_response at REPL.jl:133
in print_response at REPL.jl:120
in anonymous at REPL.jl:600
in run_interface at ./LineEdit.jl:1566
in run_frontend at ./REPL.jl:841
in run_repl at ./REPL.jl:165
in _start at ./client.jl:446 |
@dlfivefifty Please quote the code when you post it here (I just editted them to include the quote) It's really hard to read when they are not quoted. Judging from the |
@yuyichao Sorry about that, I will do so in the future. Thanks for fixing it for me! |
Adding the following line fixed this particular bug: Base.convert{CW<:ConversionWrapper}(::Type{CW},D::CW)=D Maybe I should just close the issue since it's too buried at the moment to be tracked down? |
This is caused by #11874 |
There's a strange bug that is causing segfaults and other behaviour in Julia 0.4 that's being triggered in ApproxFun. Sorry I haven't been able to narrow it down further but I reduced it to the following, where
S.op
is bizarrely aDataType
instead of an instance of the type:The definition of
SpaceOperator
doesn't allowS.op
to be a DataType:I believe the bug is triggered by an error in a Base.convert overrides, but even so, it shouldn't propagate like this.
The text was updated successfully, but these errors were encountered: