Nafiul Islam
Nafiul Islam

Reputation: 82570

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

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.

Upvotes: 5

Views: 3597

Answers (1)

basarat
basarat

Reputation: 276235

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).

Upvotes: 8

Related Questions