-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Invalid property access in quick info relating to type arguments #4616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This happens with the following SyntaxKinds in the definition: SyntaxKind.ConstructorType,
SyntaxKind.ConstructSignature,
SyntaxKind.IndexSignature,
SyntaxKind.CallSignature,
SyntaxKind.MethodSignature Since all of those are 'isFunctionLike`, and are returned by getContainingFunction but are not the node on which that type parameter lies. (I believe) Here's a comprehensive set of tests exposing the issues: ///<reference path="fourslash.ts" />
//// type Ctor<AA> = new () => A/*1*/A;
//// type MixinCtor<AA> = new () => AA & { constructor: MixinCtor<A/*2*/A> };
//// type NestedCtor<AA> = new() => AA & (new () => AA & { constructor: NestedCtor<A/*3*/A> });
//// type Method<AA> = { method(): A/*4*/A };
//// type Construct<AA> = { new(): A/*5*/A };
//// type Call<AA> = { (): A/*6*/A };
//// type Index<AA> = {[foo: string]: A/*7*/A};
//// type GenericMethod<AA> = { method<BB>(): A/*8*/A & B/*9*/B }
goTo.marker('1');
verify.quickInfoIs('(type parameter) AA in type Ctor<AA>');
goTo.marker('2');
verify.quickInfoIs('(type parameter) AA in type MixinCtor<AA>');
goTo.marker('3');
verify.quickInfoIs('(type parameter) AA in type NestedCtor<AA>');
goTo.marker('4');
verify.quickInfoIs('(type parameter) AA in type Method<AA>');
goTo.marker('5');
verify.quickInfoIs('(type parameter) AA in type Construct<AA>');
goTo.marker('6');
verify.quickInfoIs('(type parameter) AA in type Call<AA>');
goTo.marker('7');
verify.quickInfoIs('(type parameter) AA in type Index<AA>');
goTo.marker('8');
verify.quickInfoIs('(type parameter) AA in type GenericMethod<AA>');
goTo.marker('9');
verify.quickInfoIs('(type parameter) BB in method<BB>(): AA & BB'); The issue is on ~line 4228 of |
I also advise checking against the quick infos for this, in additon to those in the test above: type Nesting<T> = {method<U>(): new <W>() => T & U & W}; On 4a85546 this errors on |
Hover over the
A
at/**/
.Expected:
A in MixinCtor<A>
Actual: The language service tries to get
length
off ofundefined
, crashes.The text was updated successfully, but these errors were encountered: