Skip to content
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

RFC: move Vararg specType rewriting into dispatch #16159

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c9fe086
Add a length parameter N to Vararg, Vararg{T,N}
timholy May 3, 2015
cde289a
Add NTuple translation utilities
timholy May 3, 2015
458cdde
Add flexible Vararg info utilities
timholy May 3, 2015
0b53e36
Add new jl_tuple_subtype_ algorithm
timholy May 4, 2015
4acbe56
Test jl_subtype_le more thoroughly, return "new" result
timholy May 9, 2015
6125202
Update jl_type_morespecific
timholy May 9, 2015
469a244
Update type_match for new va tuples
timholy May 10, 2015
d0c5848
Implement jl_type_intersect for new Vararg tuples
timholy May 10, 2015
a4903e4
Update typejoin for new Varargs
timholy May 10, 2015
302a951
Delete redundant debugging code
timholy May 10, 2015
5f2cd6a
Instantiate Tuple{Vararg{Int,3}} as Tuple{Int,Int,Int}
timholy May 10, 2015
15d95ad
Make NTuple{N,T} a typealias for Tuple{Vararg{T,N}}
timholy May 11, 2015
ed641b3
Don't wrap V<:Vararg in TypeVar(:_, V)
timholy May 17, 2015
6b96ae7
Fix problem with NTuple instantiation
timholy May 18, 2015
162c92d
Delete debugging code
timholy May 18, 2015
396b0ac
Add docs and NEWS on Vararg{T,N}
timholy May 18, 2015
52708c5
Don't assume a limited set of types for N in Vararg{T,N}
timholy May 18, 2015
11cdf6f
Add more Vararg{T,N} tests
timholy May 18, 2015
08f7f8e
Incorporate type_match_invariance_mask in tuple_match
timholy Jan 3, 2016
919604e
Add space in Vararg test expectation
timholy Jan 3, 2016
8b26138
Provide more useful debugging info from testintersect
timholy Jun 4, 2015
1711ea5
Fix segfault with invoke
timholy Jun 4, 2015
db39b22
Fix Type{Tuple{}} <: Type{NTuple{TypeVar(:N,true)}}
timholy Jun 4, 2015
974a73c
Validate Vararg parameters
timholy Jan 3, 2016
8dc43c5
Re-fix #12092
timholy Jan 3, 2016
908047b
Rename enum types
timholy Jan 10, 2016
ddf288b
Delete unused inst_tupletype_unchecked_uncached
timholy Jan 10, 2016
ac9ed2b
Fix Vararg method printing
timholy Apr 10, 2016
9f3f075
normalize more Tuple{Vararg{T,N}} to Tuple{T,...}
vtjnash Apr 29, 2016
0bd3fb5
apply type-signature correction to ml-matches
vtjnash Apr 30, 2016
578fe68
move normalization of Varargs type signature tuple earlier
vtjnash May 2, 2016
47101ac
fix typemap va marking rebase error
vtjnash May 2, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Instantiate Tuple{Vararg{Int,3}} as Tuple{Int,Int,Int}
  • Loading branch information
timholy authored and vtjnash committed Apr 29, 2016
commit 5f2cd6af6836c19cb75756d4d27384cd54b52969
7 changes: 7 additions & 0 deletions src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,13 @@ static void check_tuple_parameter(jl_value_t *pi, size_t i, size_t np)

static jl_tupletype_t *jl_apply_tuple_type_v_(jl_value_t **p, size_t np, jl_svec_t *params)
{
if (np == 1 && jl_is_vararg_type(p[0])) {
jl_datatype_t *va = (jl_datatype_t*)p[0];
if (jl_is_long(jl_tparam1(va))) {
size_t nt = jl_unbox_long(jl_tparam1(va));
return (jl_tupletype_t*)jl_tupletype_fill(nt, jl_tparam0(va));
}
}
int isabstract = 0, cacheable = 1;
for(size_t i=0; i < np; i++) {
jl_value_t *pi = p[i];
Expand Down
2 changes: 1 addition & 1 deletion test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ begin
test_mt(f1, "f1(x...)")
test_mt(f2, "f2(x::Vararg{Any})")
test_mt(f3, "f3(x::Vararg{T<:Any})") # FIXME? better as x::Vararg?
test_mt(f4, "f4(x::Vararg{Any,3})")
# test_mt(f4, "f4(x::Vararg{Any,3})")
intstr = string(Int)
test_mt(f5, "f5{T,N}(A::AbstractArray{T,N},indexes::Vararg{$intstr,N})")
end
Expand Down