@@ -1535,6 +1535,8 @@ module ts {
1535
1535
}
1536
1536
1537
1537
function writeSymbolTypeReference(symbol: Symbol, typeArguments: Type[], pos: number, end: number) {
1538
+ // Unnamed function expressions, arrow functions, and unnamed class expressions have reserved names that
1539
+ // we don't want to display
1538
1540
if (!isReservedMemberName(symbol.name)) {
1539
1541
buildSymbolDisplay(symbol, writer, enclosingDeclaration, SymbolFlags.Type);
1540
1542
}
@@ -3522,8 +3524,12 @@ module ts {
3522
3524
let expectedTypeArgCount = localTypeParameters ? localTypeParameters.length : 0;
3523
3525
let typeArgCount = node.typeArguments ? node.typeArguments.length : 0;
3524
3526
if (typeArgCount === expectedTypeArgCount) {
3525
- type = createTypeReference(<GenericType>type, concatenate((<InterfaceType>type).outerTypeParameters,
3526
- map(node.typeArguments, getTypeFromTypeNode)));
3527
+ // When no type arguments are expected we already have the right type because all outer type parameters
3528
+ // have themselves as default type arguments.
3529
+ if (typeArgCount) {
3530
+ type = createTypeReference(<GenericType>type, concatenate((<InterfaceType>type).outerTypeParameters,
3531
+ map(node.typeArguments, getTypeFromTypeNode)));
3532
+ }
3527
3533
}
3528
3534
else {
3529
3535
error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), expectedTypeArgCount);
0 commit comments