Skip to content

Commit

Permalink
Fix inference for splatting numbers (Int32/64 and Float32/64)
Browse files Browse the repository at this point in the history
Fixes #22291
  • Loading branch information
timholy committed Jun 17, 2017
1 parent 44a9a19 commit bef89bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,8 @@ function precise_container_type(arg::ANY, typ::ANY, vtypes::VarTable, sv::Infere
end
elseif tti0 <: Array
return Any[Vararg{eltype(tti0)}]
elseif tti0 <: corenumtype
return Any[tti0]
else
return Any[abstract_iteration(typ, vtypes, sv)]
end
Expand Down
5 changes: 5 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5065,3 +5065,8 @@ f_isdefined_cl_6() = (local x; () -> @isdefined x)
@test !f_isdefined_cl_4()
@test f_isdefined_cl_5()()
@test !f_isdefined_cl_6()()

# issue #22291
wrap22291(ind) = (ind...)
@test @inferred(wrap22291(1)) == (1,)
@test @inferred(wrap22291((1, 2))) == (1, 2)

0 comments on commit bef89bd

Please sign in to comment.