Skip to content

Commit 82e96a4

Browse files
committed
fix #7221, method sorting bug
1 parent 2bd7406 commit 82e96a4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/jltypes.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -2517,9 +2517,7 @@ static int jl_type_morespecific_(jl_value_t *a, jl_value_t *b, int invariant)
25172517
return 1;
25182518
}
25192519
}
2520-
if (!jl_is_typevar(b))
2521-
return 0;
2522-
return 1;
2520+
return 0;
25232521
}
25242522

25252523
if (jl_is_type_type(a) && !invariant) {

test/core.jl

+6
Original file line numberDiff line numberDiff line change
@@ -2223,3 +2223,9 @@ end
22232223
@test f10373.env.defs.next.func.code.name == :f10373
22242224
@test g10373.env.defs.func.code.name == :g10373
22252225
@test g10373.env.defs.next.func.code.name == :g10373
2226+
2227+
# issue #7221
2228+
f7221{T<:Number}(::T) = 1
2229+
f7221(::BitArray) = 2
2230+
f7221(::AbstractVecOrMat) = 3
2231+
@test f7221(trues(1)) == 2

0 commit comments

Comments
 (0)