Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JuliaLang/julia
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Oct 20, 2014
2 parents 19eb2fa + 6290d34 commit 35eced3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2194,8 +2194,11 @@ static int jl_subtype_le(jl_value_t *a, jl_value_t *b, int ta, int invariant)
if (jl_subtype_le(a, jl_tparam0(b), 0, 1))
return 1;
}
if (invariant && ttb == (jl_datatype_t*)ttb->name->primary)
return 0;
assert(jl_tuple_len(tta->parameters) == jl_tuple_len(ttb->parameters));
for(i=0; i < jl_tuple_len(tta->parameters); i++) {
size_t l = jl_tuple_len(tta->parameters);
for(i=0; i < l; i++) {
jl_value_t *apara = jl_tupleref(tta->parameters,i);
jl_value_t *bpara = jl_tupleref(ttb->parameters,i);
if (invariant && jl_is_typevar(bpara) &&
Expand Down
11 changes: 7 additions & 4 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1489,10 +1489,13 @@
`(block (= (tuple ,k ,v) ,rk)
,push-expr))))
restkeys))
(if (call (top isempty) ,container)
(call ,f ,@pa)
(call (top kwcall) ,f ,(length keys) ,@keyargs
,container ,@pa))))))))
,(let ((kw-call `(call (top kwcall) ,f ,(length keys) ,@keyargs
,container ,@pa)))
(if (not (null? keys))
kw-call
`(if (call (top isempty) ,container)
(call ,f ,@pa)
,kw-call)))))))))

(define (expand-transposed-op e ops)
(let ((a (caddr e))
Expand Down
2 changes: 2 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ end
@test !isa((Int,), Type{(Int...,)})
@test !isa((Int,), Type{(Any...,)})

@test !issubtype(Type{Array{TypeVar(:T,true)}}, Type{Array})

# issue #6561
@test issubtype(Array{Tuple}, Array{NTuple})
@test issubtype(Array{(Any...)}, Array{NTuple})
Expand Down

0 comments on commit 35eced3

Please sign in to comment.