Can you define generics with safe types, as you can with c#?
E.g.
public bool Foo<T>() where T : struct { /* */ }
Typescript now has generics, but can I perform a similar action?
Thanks.
Ok it seems you can do this:
Foo<T extends IBar>() { /* */ }
And that seems to make all calls require the T to implement IBar.
IBar
1.4m articles
1.4m replys
5 comments
57.0k users