Type arguments
Type arguments must be specified. When referencing a genericContainer, T must be provided explicitly:
Default type arguments
A type parameter can have a default type:<T = xxx>. Such type parameters may be omitted at use sites.
T2 = T1 are invalid.
Type aliases
Generic parameters are supported not only by structs, but also by type aliases. The following example defines a generic type aliasResponse<TResult, TError>:
Methods
Methods for generics are declared exactly as for regular structures. In this form, the compiler treatsT, which is unknown symbol, as a type parameter:
self parameter, a method will be static.