Using of non exported functions of Base in package code

Well, I’ve tried your suggestion but I get only the Union type back. What I’m Interested in is the type T itself. I you use your suggestion you will get the following:
f(::Optional{T}) where {T} = T with Optional{String} gives Union and I’m interested in String.