Skip to content

Commit 41f07ac

Browse files
authored
remove error when calling fieldtype on a Module (#34804)
1 parent 7e2363b commit 41f07ac

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/builtins.c

Lines changed: 0 additions & 2 deletions
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

Lines changed: 4 additions & 0 deletions
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)