Skip to content

Commit b5c2cbe

Browse files
committed
remove error when calling fieldtype on a Module (#34804)
1 parent 9d7b13e commit b5c2cbe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/builtins.c

-2
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,6 @@ JL_CALLABLE(jl_f_fieldtype)
885885
}
886886
JL_NARGS(fieldtype, 2, 2);
887887
jl_datatype_t *st = (jl_datatype_t*)args[0];
888-
if (st == jl_module_type)
889-
jl_error("cannot assign variables in other modules");
890888
return get_fieldtype(args[0], args[1], 1);
891889
}
892890

test/misc.jl

+4
Original file line numberDiff line numberDiff line change
@@ -804,3 +804,7 @@ end
804804

805805
GC.safepoint()
806806
end
807+
808+
@testset "fieldtypes Module" begin
809+
@test fieldtypes(Module) isa Tuple
810+
end

0 commit comments

Comments
 (0)