File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12002,10 +12002,6 @@ module ts {
1200212002 return unknownType;
1200312003 }
1200412004
12005- if (isClassExtendsExpressionWithTypeArguments(node)) {
12006- return getBaseTypes(<InterfaceType>getDeclaredTypeOfSymbol(getSymbolOfNode(node.parent.parent)))[0];
12007- }
12008-
1200912005 if (isTypeNode(node)) {
1201012006 return getTypeFromTypeNode(<TypeNode>node);
1201112007 }
@@ -12014,6 +12010,12 @@ module ts {
1201412010 return getTypeOfExpression(<Expression>node);
1201512011 }
1201612012
12013+ if (isClassExtendsExpressionWithTypeArguments(node)) {
12014+ // A SyntaxKind.ExpressionWithTypeArguments is considered a type node, except when it occurs in the
12015+ // extends clause of a class. We handle that case here.
12016+ return getBaseTypes(<InterfaceType>getDeclaredTypeOfSymbol(getSymbolOfNode(node.parent.parent)))[0];
12017+ }
12018+
1201712019 if (isTypeDeclaration(node)) {
1201812020 // In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration
1201912021 let symbol = getSymbolOfNode(node);
Original file line number Diff line number Diff line change @@ -41,7 +41,10 @@ class TypeWriterWalker {
4141 var lineAndCharacter = this . currentSourceFile . getLineAndCharacterOfPosition ( actualPos ) ;
4242 var sourceText = ts . getTextOfNodeFromSourceText ( this . currentSourceFile . text , node ) ;
4343
44- var type = this . checker . getTypeAtLocation ( node ) ;
44+ // Workaround to ensure we output 'C' instead of 'typeof C' for base class expressions
45+ // var type = this.checker.getTypeAtLocation(node);
46+ var type = node . parent && ts . isClassExtendsExpressionWithTypeArguments ( node . parent ) && this . checker . getTypeAtLocation ( node . parent ) || this . checker . getTypeAtLocation ( node ) ;
47+
4548 ts . Debug . assert ( type !== undefined , "type doesn't exist" ) ;
4649 var symbol = this . checker . getSymbolAtLocation ( node ) ;
4750
You can’t perform that action at this time.
0 commit comments