Skip to content
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

Error with UnionAll has no field parameters #499

Closed
jishnub opened this issue Sep 6, 2023 · 2 comments
Closed

Error with UnionAll has no field parameters #499

jishnub opened this issue Sep 6, 2023 · 2 comments

Comments

@jishnub
Copy link
Contributor

jishnub commented Sep 6, 2023

Using the branch https://github.com/jishnub/ApproxFunSingularities.jl/tree/mulitercthulhucrash,

julia> using ApproxFunSingularities

julia> genf(β,α) = Fun(x -> (1+x)^β * (1-x)^α, JacobiWeight(β,α,ConstantSpace(ChebyshevInterval())));

julia> f = genf(0,2);

julia> J = Jacobi(5,5);

julia> @descend_code_warntype Multiplication(f,J)
Multiplication(f::Fun{<:JacobiWeight{<:ConstantSpace, <:Union{SegmentDomain{T}, IntervalSets.AbstractInterval{T}} where T}}, S::Jacobi) @ ApproxFunSingularities ~/.julia/packages/ApproxFunSingularities/oj5qI/src/JacobiWeight.jl:424
ERROR: type UnionAll has no field parameters
Stacktrace:
  [1] getproperty
    @ ./Base.jl:32 [inlined]
  [2] type_annotation_mode(node::JuliaSyntax.TreeNode{TypedSyntax.TypedSyntaxData}, T::Any; type_annotations::Bool, hide_type_stable::Bool)
    @ TypedSyntax ~/.julia/packages/TypedSyntax/ByLzZ/src/show.jl:104
  [3] type_annotation_mode
    @ ~/.julia/packages/TypedSyntax/ByLzZ/src/show.jl:97 [inlined]
  [4] show_src_expr(io::IOContext{IOBuffer}, node::JuliaSyntax.TreeNode{TypedSyntax.TypedSyntaxData}, position::Int64, pre::String, pre2::String; type_annotations::Bool, iswarn::Bool, hide_type_stable::Bool, nd::Int64)
    @ TypedSyntax ~/.julia/packages/TypedSyntax/ByLzZ/src/show.jl:79
  [5] show_src_expr(io::IOContext{IOBuffer}, node::JuliaSyntax.TreeNode{TypedSyntax.TypedSyntaxData}, position::Int64, pre::String, pre2::String; type_annotations::Bool, iswarn::Bool, hide_type_stable::Bool, nd::Int64) (repeats 6 times)
    @ TypedSyntax ~/.julia/packages/TypedSyntax/ByLzZ/src/show.jl:80
  [6] show_src_expr
    @ ~/.julia/packages/TypedSyntax/ByLzZ/src/show.jl:66 [inlined]
  [7] printstyled(io::IOContext{IOBuffer}, rootnode::JuliaSyntax.TreeNode{TypedSyntax.TypedSyntaxData}; type_annotations::Bool, iswarn::Bool, hide_type_stable::Bool, with_linenumber::Bool, idxend::Int64)
    @ TypedSyntax ~/.julia/packages/TypedSyntax/ByLzZ/src/show.jl:50
  [8] printstyled
    @ ~/.julia/packages/TypedSyntax/ByLzZ/src/show.jl:32 [inlined]
  [9] cthulhu_typed(io::IOContext{IOBuffer}, debuginfo::Symbol, src::Core.CodeInfo, rt::Any, effects::Core.Compiler.Effects, mi::Core.MethodInstance; iswarn::Bool, hide_type_stable::Bool, optimize::Bool, pc2remarks::Nothing, pc2effects::Nothing, inline_cost::Bool, type_annotations::Bool, annotate_source::Bool, inlay_types_vscode::Bool, diagnostics_vscode::Bool, jump_always::Bool, interp::Cthulhu.CthulhuInterpreter)
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/codeview.jl:168
 [10] cthulhu_typed
    @ ~/.julia/packages/Cthulhu/9kV71/src/codeview.jl:123 [inlined]
 [11] #cthulhu_typed#58
    @ ~/.julia/packages/Cthulhu/9kV71/src/codeview.jl:121 [inlined]
 [12] (::Cthulhu.var"#96#103"{Cthulhu.CthulhuInterpreter, Cthulhu.DInfo.DebugInfo, Core.CodeInfo, Core.CodeInfo, Union, Core.MethodInstance, Bool, Bool, Nothing, Nothing, Bool, Bool})(lambda_io::IOContext{IOBuffer})
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/Cthulhu.jl:492
 [13] stringify(f::Any, context::IOContext{Base.TTY})
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/ui.jl:90
 [14] _descend(term::REPL.Terminals.TTYTerminal, interp::Cthulhu.CthulhuInterpreter, curs::Cthulhu.CthulhuCursor; override::Nothing, debuginfo::Symbol, optimize::Bool, interruptexc::Bool, iswarn::Bool, hide_type_stable::Bool, verbose::Nothing, remarks::Bool, with_effects::Bool, inline_cost::Bool, type_annotations::Bool, annotate_source::Bool, inlay_types_vscode::Bool, diagnostics_vscode::Bool, jump_always::Bool)
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/Cthulhu.jl:491
 [15] _descend(term::REPL.Terminals.TTYTerminal, interp::Cthulhu.CthulhuInterpreter, mi::Core.MethodInstance; kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:iswarn,), Tuple{Bool}}})
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/Cthulhu.jl:756
 [16] _descend(::REPL.Terminals.TTYTerminal, ::Any, ::Vararg{Any}; interp::Core.Compiler.NativeInterpreter, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:iswarn,), Tuple{Bool}}})
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/Cthulhu.jl:772
 [17] __descend_with_error_handling(args::Any; terminal::Any, kwargs::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/Cthulhu.jl:213
 [18] _descend_with_error_handling(f::Any, argtypes::Any; kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:iswarn,), Tuple{Bool}}})
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/Cthulhu.jl:202
 [19] descend_code_warntype(::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/Cthulhu.jl:191
 [20] descend_code_warntype(::Any, ::Any)
    @ Cthulhu ~/.julia/packages/Cthulhu/9kV71/src/Cthulhu.jl:191
 [21] top-level scope
    @ REPL[8]:1

(@v1.9) pkg> st -m Cthulhu
Status `~/.julia/environments/v1.9/Manifest.toml`
  [f68482b8] Cthulhu v2.9.3

(@v1.9) pkg> st -m TypedSyntax
Status `~/.julia/environments/v1.9/Manifest.toml`
  [d265eb64] TypedSyntax v1.2.2

julia> VERSION
v"1.9.3"

In case this matters, there is a typo on https://github.com/jishnub/ApproxFunSingularities.jl/blob/f265ceb42ab637b9d57257a68f5271ab3ca119f7/src/JacobiWeight.jl#L455 where I've used i instead of a as the loop variable, which wrecks type-inference.

@timholy
Copy link
Member

timholy commented Sep 6, 2023

Probably already fixed on Cthulhu/TypedSyntax master.

@jishnub
Copy link
Contributor Author

jishnub commented Sep 6, 2023

Indeed, this seems to be fixed on the master for TypedSyntax. Probably needs a release

@jishnub jishnub closed this as completed Sep 6, 2023
jishnub referenced this issue Sep 6, 2023
Fixes type Union has no field parameters #494
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants