Skip to content

Commit

Permalink
remove error when calling fieldtype on a Module (#34804)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Feb 20, 2020
1 parent 7e2363b commit 41f07ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,6 @@ JL_CALLABLE(jl_f_fieldtype)
}
JL_NARGS(fieldtype, 2, 2);
jl_datatype_t *st = (jl_datatype_t*)args[0];
if (st == jl_module_type)
jl_error("cannot assign variables in other modules");
return get_fieldtype(args[0], args[1], 1);
}

Expand Down
4 changes: 4 additions & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -804,3 +804,7 @@ end

GC.safepoint()
end

@testset "fieldtypes Module" begin
@test fieldtypes(Module) isa Tuple
end

0 comments on commit 41f07ac

Please sign in to comment.