We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Passing function keywords through a second function call seems to break type inference:
using StaticArrays, Base.Test foo{n,T<:AbstractFloat}(f, a::SVector{n,T}, b::SVector{n,T}; norm=vecnorm) = f(norm(a + b) * n) function foo(f, a::SVector{n,T}, b::SVector{n,S}; kws...) where {n,T<:Real,S<:Real} F = float(promote_type(T,S)) return foo(f, SVector{n,F}(a), SVector{n,F}(b); kws...) end @inferred foo(abs, SVector(0.), SVector(1.)) # succeeds @inferred foo(abs, SVector(0), SVector(1)) # FAILS!
If I delete the kws... in the second foo method then inference succeeds.
kws...
foo
The text was updated successfully, but these errors were encountered:
Yes, this is a pretty well-known pothole; see for example #9551 #21794 #21811.
Sorry, something went wrong.
type inference fixes and tests, work around JuliaLang/julia#22885
174a8a5
Closing as dup.
No branches or pull requests
Passing function keywords through a second function call seems to break type inference:
If I delete the
kws...
in the secondfoo
method then inference succeeds.The text was updated successfully, but these errors were encountered: