Merge pull request #7144 from Microsoft/super-inside-inner-class-crashes

Super inside inner class crashes
This commit is contained in:
Nathan Shively-Sanders 2016-02-19 08:45:35 -08:00
commit e46b7b05ab
2 changed files with 19 additions and 2 deletions

View File

@ -10112,8 +10112,10 @@ namespace ts {
// In super call, the candidate signatures are the matching arity signatures of the base constructor function instantiated
// with the type arguments specified in the extends clause.
const baseTypeNode = getClassExtendsHeritageClauseElement(getContainingClass(node));
const baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments);
return resolveCall(node, baseConstructors, candidatesOutArray);
if (baseTypeNode) {
const baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments);
return resolveCall(node, baseConstructors, candidatesOutArray);
}
}
return resolveUntypedCall(node);
}

View File

@ -0,0 +1,15 @@
/// <reference path="fourslash.ts" />
////class Base {
//// constructor(n: number) {
//// }
////}
////class Derived extends Base {
//// constructor() {
//// class Nested {
//// [super(/*1*/)] = 11111
//// }
//// }
////}
goTo.marker('1');
verify.signatureHelpCountIs(0);