-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
convert(T<:StaticInt{8}, x)
does not always return a T
#96
Comments
Doesn't seem like returning |
That would be consistent with |
function convert(::StaticInt{N}, x) where {N}
# choose whether you want the check to
# possibly be skippable in the future:
# x == N || throw(ArgumentError("$x != $N, so can't convert to a static($N)"))
@assert x == N "$x != $N, so can't convert to a static($N)"
return StaticInt{N}()
end Seems like a reasonable definition. |
Looks like this was with |
Sorry, I didn't look at the stacktrace: [1] convert
@ ./number.jl:7 [inlined]
[2] oftype(x::Static.StaticInt{8}, y::Int64)
@ Base ./essentials.jl:471
[3] zero(x::Static.StaticInt{8})
@ Base ./number.jl:308
[4] unsigned(x::Static.StaticInt{8})
@ Base ./int.jl:215
[5] divrem_fast
@ ~/.julia/packages/Octavian/tN2Zr/src/integerdivision.jl:9 [inlined] I thought Octavian was calling |
I've seen this error in e.g. PkgEval https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/7daffee_vs_00177eb/Fenrir.primary.log.
Ends up erroring from https://github.com/JuliaLinearAlgebra/Octavian.jl/blob/430701e05a88176ba1cf313b22f3a5c687fbfd4b/src/Octavian.jl#L49. cc @chriselrod
Having
convert(Type{T}, x)
return aT
is pretty fundamental in Julia.The text was updated successfully, but these errors were encountered: