Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript Error Message error TS2173: Generic type references must include all type arguments

Tags:

typescript

I was just trying to compile the latest version of the jquery declaration file from definitelyTyped, here.

The problem I have here, right now is this:

C:/nodejs/tsc.cmd --sourcemap jquery.d.ts --module commonjs --target ES5
C:/gamesbrainiac/d.ts/DefinitelyTyped/jquery/jquery.d.ts(491,40): error TS2173: Generic type references must include all type arguments.

node running @ version 0.10.3 and Typescript @ version 0.9.1.1.

What does this error mean, I'd like to understand the error messages so that I can solve the problems myself, instead of asking others to do it for me.

like image 364
Games Brainiac Avatar asked Aug 22 '13 12:08

Games Brainiac


1 Answers

That line should have been:

promise(type?: any, target?: any): JQueryPromise<any>;

I'll send them a pull request. Thanks.

JQueryPromise is a generic interface. i.e. it takes type parameters. Starting with TS 0.9.1.1 they are more strict about generic parameters. They must be specified from now on. This was allowed in previous versions (where the type was assumed to any implicitly) but the compiler analysis is stricter now (and the type must be specified explicitly).

like image 96
basarat Avatar answered Sep 19 '22 16:09

basarat