Skip to content

Fix type instability in constructors.jl #621

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

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

jondeuce
Copy link
Contributor

Small bugfix, just missing a type parameter in zeros.

Before this PR:

julia> using ApproxFunBase, ApproxFun

julia> @code_warntype Fun(exp, Chebyshev(big(-1.0) .. big(1.0)))
MethodInstance for Fun(::typeof(exp), ::Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat})
  from Fun(f, d::Space) @ ApproxFunBase ~/.julia/dev/ApproxFunBase/src/constructors.jl:225
Arguments
  #self#::Type{Fun}
  f::Core.Const(exp)
  d::Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat}
Body::Union{Fun{Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat}, Float64, Vector{Float64}}, Fun{Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat}, BigFloat, Vector{BigFloat}}}
1%1 = ApproxFunBase.default_Fun(f, d)::Union{Fun{Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat}, Float64, Vector{Float64}}, Fun{Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat}, BigFloat, Vector{BigFloat}}}
└──      return %1

After this PR:

julia> @code_warntype Fun(exp, Chebyshev(big(-1.0) .. big(1.0)))
MethodInstance for Fun(::typeof(exp), ::Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat})
  from Fun(f, d::Space) @ ApproxFunBase ~/.julia/dev/ApproxFunBase/src/constructors.jl:225
Arguments
  #self#::Type{Fun}
  f::Core.Const(exp)
  d::Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat}
Body::Fun{Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat}, BigFloat, Vector{BigFloat}}
1%1 = ApproxFunBase.default_Fun(f, d)::Fun{Chebyshev{IntervalSets.ClosedInterval{BigFloat}, BigFloat}, BigFloat, Vector{BigFloat}}
└──      return %1

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c676431) 70.71% compared to head (38c9f11) 75.08%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #621      +/-   ##
==========================================
+ Coverage   70.71%   75.08%   +4.36%     
==========================================
  Files          80       80              
  Lines        8398     8437      +39     
==========================================
+ Hits         5939     6335     +396     
+ Misses       2459     2102     -357     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jishnub jishnub merged commit 9978bfa into JuliaApproximation:master Jan 18, 2024
@jishnub
Copy link
Member

jishnub commented Jan 18, 2024

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants