Generics update

Topics: General, Language Specification
Feb 28, 2013 at 10:29 PM
Edited Feb 28, 2013 at 10:29 PM
In case you missed it, Jon Turner updated the generics issue with new information yesterday.

https://typescript.codeplex.com/workitem/185

Everything outlined there sounds great. I hope the type inference makes it into the initial release of generics, as explicitly writing out generic parameters in method calls is really cumbersome. I'm also looking forward to seeing more details about the generic type constraints.
Coordinator
Mar 26, 2013 at 1:04 AM
Also just blogged a few more details here:

http://blogs.msdn.com/b/typescript/archive/2013/03/25/working-on-typescript-0-9-generics-overload-on-constants-and-compiler-performance.aspx

Generic parameter inference is definitely part of the plan for the initial release of generics (this is already implemented in the 'develop' branch). Generic constraints are also part of the plan, and are used like this:
    interface EventListener<TEvent extends Event> {
      (evt: TEvent): void;
    }
Mar 26, 2013 at 4:00 PM
Awesome, thanks. Can't wait to try it out and add generic typing into all the linq.js and JQuerred Deferred code that I use.