Skip to content

Commit

Permalink
Fix active reg inner of literal type
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Sep 28, 2024
1 parent 55582f8 commit 642e809
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ end
return AnyState
end

if isghostty(T) || Core.Compiler.isconstType(T)
if isghostty(T) || Core.Compiler.isconstType(T) || T <: Type
return AnyState
end

Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ mutable struct MInts{A, B}
end

@testset "Internal tests" begin
@assert Enzyme.Compiler.active_reg_inner(Type{Array}, (), nothing) == Enzyme.Compiler.AnyState
@assert Enzyme.Compiler.active_reg_inner(Ints{<:Any, Integer}, (), nothing) == Enzyme.Compiler.AnyState
@assert Enzyme.Compiler.active_reg_inner(Ints{<:Any, Float64}, (), nothing) == Enzyme.Compiler.DupState
@assert Enzyme.Compiler.active_reg_inner(Ints{Integer, <:Any}, (), nothing) == Enzyme.Compiler.DupState
Expand Down

0 comments on commit 642e809

Please sign in to comment.