Parsing non-Core types from a config file

Hi all,

I’m having some trouble with the code below.

I am writing a module that contains a function taking a String input (from a config file) and returns a DataType. The function aims to parse the string to a DataType. For example, f("UInt8") returns UInt8.

The function works for Core types, such as UInt8 and Float64.
But it throws an error when parsing a non-core type because the module that defines the function hasn’t imported the type.

How can I get this to work without importing all possible types into the module that defines the function?

module mymod1
    export f

    f(s::String) = eval(Meta.parse(s))
end

module mymod2
    using mymod1
    using TimeZones

    f("Float64")  # Float64
    s = "TimeZones.ZonedDateTime"
    println(eval(Meta.parse(s)))  # OK
    f(s)  # Error
end