Skip to content

Commit ce1d03c

Browse files
committed
inference: TypeVar == 1 is a useful base case to allow in recursion
(e.g. reinterpret to a Vector)
1 parent 59bd6f3 commit ce1d03c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

base/inference.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,8 @@ function type_more_complex(t::ANY, c::ANY, sources::SimpleVector)
802802
end
803803
elseif t === c
804804
return false
805+
elseif isa(t, Int) && isa(c, Int)
806+
return t === 1 # alternatively: 0 <= t < c
805807
end
806808
return true
807809
end

0 commit comments

Comments
 (0)