-
-
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
all([static(true), static(true)])
fails
#36
Comments
julia> [static(true), false]
2-element Vector{Bool}:
1
0
julia> [static(true), static(false)]
2-element Vector{StaticBool}:
static(true)
static(false) I think we want a We probably always want |
I agree, but this could work too: julia> using Static
julia> x = [static(true), static(true)]
2-element Vector{True}:
static(true)
static(true)
julia> Base.all(v::AbstractArray{B}) where {B<:StaticBool} = all(dynamic, v)
julia> all(x)
true |
If you really want to define that, I'd add Base.all(v::AbstractArray{SB}) where {B,SB<:StaticBool{B}} = B That way julia> w = [static(true), static(true)]
2-element Vector{True}:
static(true)
static(true)
julia> x = [static(true), static(false)]
2-element Vector{StaticBool}:
static(true)
static(false)
julia> Base.all(v::AbstractArray{B}) where {B<:StaticBool} = all(dynamic, v)
julia> Base.all(v::AbstractArray{SB}) where {B,SB<:StaticBool{B}} = B
julia> @code_typed all(w)
CodeInfo(
1 ─ return $(Expr(:static_parameter, 1))
) => Bool
julia> @code_llvm all(w)
define i8 @julia_all_1706({} addrspace(10)* nonnull align 16 dereferenceable(40) %0) #0 !dbg !5 {
top:
ret i8 1, !dbg !7
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With Julia 1.7.1 and Static 0.5.1,
The problem seems to coming from this in Base:
Interestingly, these work fine:
The text was updated successfully, but these errors were encountered: