Hmmm. It is the first time I heard about this function. It uses Core.Compiler.typesubtract
. Thank you.
A poor man’s nonnothingtype
:
nonnothingtype(::Type{T}) where {T} = Core.Compiler.typesubtract(T, Nothing)
I did a little bit search and found some links, hope this would help others: