UnionAll question

why struct G{T<:Real} ;end is right,and
struct G{T} where T<:Real ;end have error
ERROR: syntax: invalid type signature

The second is invalid syntax (you may be confusing it with method type signatures). See the documentation:
https://docs.julialang.org/en/v1/manual/types/#Parametric-Types-1

1 Like


but in UnionAll section,

where keyword is only used in function signatures?