Skip to content

Commit

Permalink
fixing the BitVector dispatch bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Apr 11, 2012
1 parent ec7c3e2 commit 2e75d14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,9 @@ static jl_value_t *jl_type_intersect(jl_value_t *a, jl_value_t *b,
JL_GC_POP();
return (jl_value_t*)jl_bottom_type;
}
// super needs to be instantiated so the matching below finds actual types
// and doesn't fail due to the presence of extra typevars.
super = (jl_tag_type_t*)jl_instantiate_type_with((jl_type_t*)super, eqc->data, eqc->n/2);

size_t n = sub->parameters->length;

Expand Down
10 changes: 10 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,13 @@ begin
some_data = {("a", Int32), ("b", Int32)}
@assert isa(mytype(some_data),Vector{(ASCIIString, BitsKind)})
end

type MyArray{N} <: AbstractArray{Int, N}
end
begin
local x
x = MyArray{1}()
foob(x::AbstractArray)=0
foob{T}(x::AbstractVector{T})=1
@assert foob(x) == 1
end

0 comments on commit 2e75d14

Please sign in to comment.