diff --git a/src/jltypes.c b/src/jltypes.c index b8a81f94a7931..10b8bc937939e 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -3581,8 +3581,11 @@ void jl_init_types(void) JL_GC_DISABLED jl_emptysvec, 0, 0, 4); // all Kinds share the Type method table (not the nonfunction one) - jl_unionall_type->name->mt = jl_uniontype_type->name->mt = jl_datatype_type->name->mt = - jl_type_type_mt; + jl_unionall_type->name->mt = + jl_uniontype_type->name->mt = + jl_datatype_type->name->mt = + jl_typeofbottom_type->name->mt = + jl_type_type_mt; jl_intrinsic_type = jl_new_primitivetype((jl_value_t*)jl_symbol("IntrinsicFunction"), core, jl_builtin_type, jl_emptysvec, 32); diff --git a/test/reflection.jl b/test/reflection.jl index 895da80e03c75..ef940b034a2e1 100644 --- a/test/reflection.jl +++ b/test/reflection.jl @@ -1296,3 +1296,5 @@ end @test Base.infer_return_type(code_lowered, (Any,)) == Vector{Core.CodeInfo} @test Base.infer_return_type(code_lowered, (Any,Any)) == Vector{Core.CodeInfo} + +@test methods(Union{}) == Any[m.method for m in Base._methods_by_ftype(Tuple{Core.TypeofBottom, Vararg}, 1, Base.get_world_counter())] # issue #55187