5

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.

1 Answer 1

8

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

Sign up to request clarification or add additional context in comments.

2 Comments

But could you just explain what you're doing when you add those angle brackets, and the error too, that was a part of the question.
They are called generic type parameters. Expanded answer as well :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.