Declaring (non-parametric) type with unspecified types inside

If I declare a type as

struct Test
    x::T where T
end

is it identical to declaring it as

struct Test
    x::Any
end

?

1 Like

Indeed. In fact, we have Any === (T where T):

julia> T where T
Any

A more direct way to check is using fieldtype/fieldtypes:

julia> struct Test
           x::T where T
       end

julia> fieldtypes(Test)
(Any,)
3 Likes