3 ms·
Obviously? Surely that's just a type constraint.
by nmca 7y ago
Obviously? Surely that's just a type constraint.
- 1000units 7y agoYes, you have to specify the constraint for code that assumes the constraint to type-check.
- jakear 7y agoC# doesn't claim to have powerful type inference a la. Haskell, so there's no reason to expect it to extract type information from usage of parameters inside generic functions. If you need functionality inside the body, you gotta declare that functionality in the type constraints.