@@ -2818,9 +2818,11 @@ namespace ts {
28182818 const parameterDeclaration = getDeclarationOfKind<ParameterDeclaration>(parameterSymbol, SyntaxKind.Parameter);
28192819 const modifiers = parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(getSynthesizedClone);
28202820 const dotDotDotToken = isRestParameter(parameterDeclaration) ? createToken(SyntaxKind.DotDotDotToken) : undefined;
2821- const name = parameterDeclaration.name.kind === SyntaxKind.Identifier ?
2822- setEmitFlags(getSynthesizedClone(parameterDeclaration.name), EmitFlags.NoAsciiEscaping) :
2823- cloneBindingName(parameterDeclaration.name);
2821+ const name = parameterDeclaration.name ?
2822+ parameterDeclaration.name.kind === SyntaxKind.Identifier ?
2823+ setEmitFlags(getSynthesizedClone(parameterDeclaration.name), EmitFlags.NoAsciiEscaping) :
2824+ cloneBindingName(parameterDeclaration.name) :
2825+ parameterSymbol.name;
28242826 const questionToken = isOptionalParameter(parameterDeclaration) ? createToken(SyntaxKind.QuestionToken) : undefined;
28252827
28262828 let parameterType = getTypeOfSymbol(parameterSymbol);
@@ -6696,8 +6698,10 @@ namespace ts {
66966698 return length(type.target.typeParameters);
66976699 }
66986700
6699- // Get type from reference to class or interface
6700- function getTypeFromClassOrInterfaceReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, symbol: Symbol, typeArgs: Type[]): Type {
6701+ /**
6702+ * Get type from type-reference that reference to class or interface
6703+ */
6704+ function getTypeFromClassOrInterfaceReference(node: TypeReferenceType, symbol: Symbol, typeArgs: Type[]): Type {
67016705 const type = <InterfaceType>getDeclaredTypeOfSymbol(getMergedSymbol(symbol));
67026706 const typeParameters = type.localTypeParameters;
67036707 if (typeParameters) {
@@ -6738,10 +6742,12 @@ namespace ts {
67386742 return instantiation;
67396743 }
67406744
6741- // Get type from reference to type alias. When a type alias is generic, the declared type of the type alias may include
6742- // references to the type parameters of the alias. We replace those with the actual type arguments by instantiating the
6743- // declared type. Instantiations are cached using the type identities of the type arguments as the key.
6744- function getTypeFromTypeAliasReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, symbol: Symbol, typeArguments: Type[]): Type {
6745+ /**
6746+ * Get type from reference to type alias. When a type alias is generic, the declared type of the type alias may include
6747+ * references to the type parameters of the alias. We replace those with the actual type arguments by instantiating the
6748+ * declared type. Instantiations are cached using the type identities of the type arguments as the key.
6749+ */
6750+ function getTypeFromTypeAliasReference(node: TypeReferenceType, symbol: Symbol, typeArguments: Type[]): Type {
67456751 const type = getDeclaredTypeOfSymbol(symbol);
67466752 const typeParameters = getSymbolLinks(symbol).typeParameters;
67476753 if (typeParameters) {
@@ -6766,16 +6772,18 @@ namespace ts {
67666772 return type;
67676773 }
67686774
6769- // Get type from reference to named type that cannot be generic (enum or type parameter)
6770- function getTypeFromNonGenericTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference, symbol: Symbol): Type {
6775+ /**
6776+ * Get type from reference to named type that cannot be generic (enum or type parameter)
6777+ */
6778+ function getTypeFromNonGenericTypeReference(node: TypeReferenceType, symbol: Symbol): Type {
67716779 if (node.typeArguments) {
67726780 error(node, Diagnostics.Type_0_is_not_generic, symbolToString(symbol));
67736781 return unknownType;
67746782 }
67756783 return getDeclaredTypeOfSymbol(symbol);
67766784 }
67776785
6778- function getTypeReferenceName(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference ): EntityNameOrEntityNameExpression | undefined {
6786+ function getTypeReferenceName(node: TypeReferenceType ): EntityNameOrEntityNameExpression | undefined {
67796787 switch (node.kind) {
67806788 case SyntaxKind.TypeReference:
67816789 return (<TypeReferenceNode>node).typeName;
@@ -6803,7 +6811,7 @@ namespace ts {
68036811 return resolveEntityName(typeReferenceName, SymbolFlags.Type) || unknownSymbol;
68046812 }
68056813
6806- function getTypeReferenceType(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference , symbol: Symbol) {
6814+ function getTypeReferenceType(node: TypeReferenceType , symbol: Symbol) {
68076815 const typeArguments = typeArgumentsFromTypeReferenceNode(node); // Do unconditionally so we mark type arguments as referenced.
68086816
68096817 if (symbol === unknownSymbol) {
@@ -6846,7 +6854,7 @@ namespace ts {
68466854 case "Object":
68476855 return anyType;
68486856 case "Function":
6849- return anyFunctionType ;
6857+ return globalFunctionType ;
68506858 case "Array":
68516859 case "array":
68526860 return !node.typeArguments || !node.typeArguments.length ? createArrayType(anyType) : undefined;
@@ -6862,7 +6870,7 @@ namespace ts {
68626870 return strictNullChecks ? getUnionType([type, nullType]) : type;
68636871 }
68646872
6865- function getTypeFromTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference ): Type {
6873+ function getTypeFromTypeReference(node: TypeReferenceType ): Type {
68666874 const links = getNodeLinks(node);
68676875 if (!links.resolvedType) {
68686876 let symbol: Symbol;
@@ -6893,7 +6901,7 @@ namespace ts {
68936901 return links.resolvedType;
68946902 }
68956903
6896- function typeArgumentsFromTypeReferenceNode(node: TypeReferenceNode | ExpressionWithTypeArguments | JSDocTypeReference ): Type[] {
6904+ function typeArgumentsFromTypeReferenceNode(node: TypeReferenceType ): Type[] {
68976905 return map(node.typeArguments, getTypeFromTypeNode);
68986906 }
68996907
0 commit comments