Skip to content

Commit 8ac4fe6

Browse files
committed
add tests for #11840 TypeConstructor gf cache issue
1 parent fea2000 commit 8ac4fe6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/core.jl

+20
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,26 @@ let T = TypeVar(:T, Tuple{Vararg{RangeIndex}}, true)
174174
@test args_morespecific(t2, t1)
175175
end
176176

177+
# issue #11840
178+
f11840(::Type) = "Type"
179+
f11840(::DataType) = "DataType"
180+
@test f11840(Type) == "DataType"
181+
@test f11840(AbstractVector) == "Type"
182+
183+
g11840(::DataType) = 1
184+
g11840(::Type) = 2
185+
@test g11840(Vector.body) == 1
186+
@test g11840(Vector) == 2
187+
@test g11840(Vector.body) == 1
188+
189+
h11840(::DataType) = '1'
190+
h11840(::Type) = '2'
191+
h11840(::TypeConstructor) = '3'
192+
@test h11840(Vector) == '3'
193+
@test h11840(Vector.body) == '1'
194+
@test h11840(Vector) == '3'
195+
196+
177197
# join
178198
@test typejoin(Int8,Int16) === Signed
179199
@test typejoin(Int,AbstractString) === Any

0 commit comments

Comments
 (0)