From 51f400ef80b7242396c2855c1a8e05a2d1460ecd Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 15 Feb 2017 11:24:16 -0800 Subject: [PATCH 1/3] [WIP] Implicit any for unsupplied type arguments --- src/compiler/checker.ts | 105 ++++++++++++++++++--------- src/compiler/diagnosticMessages.json | 6 +- src/compiler/types.ts | 9 +++ 3 files changed, 82 insertions(+), 38 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e17144c7878ea..8d757769fcc0a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4478,7 +4478,7 @@ namespace ts { const minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); const typeParamCount = length(baseSig.typeParameters); if (typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) { - const sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount)) : cloneSignature(baseSig); + const sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, /*errorNode*/ undefined)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; result.push(sig); @@ -5284,33 +5284,77 @@ namespace ts { * * @param typeArguments The supplied type arguments. * @param typeParameters The requested type parameters. - * @param minTypeArgumentCount The minimum number of required type arguments. + * @param errorNode The node on which to report any implicit `any` errors. */ - function fillMissingTypeArguments(typeArguments: Type[] | undefined, typeParameters: TypeParameter[] | undefined, minTypeArgumentCount: number) { + function fillMissingTypeArguments(typeArguments: Type[] | undefined, typeParameters: TypeParameter[] | undefined, errorNode: Node) { const numTypeParameters = length(typeParameters); if (numTypeParameters) { const numTypeArguments = length(typeArguments); - if (numTypeArguments >= minTypeArgumentCount && numTypeArguments <= numTypeParameters) { - if (!typeArguments) { - typeArguments = []; - } - + if (numTypeArguments <= numTypeParameters) { // Map an unsatisfied type parameter with a default type. // If a type parameter does not have a default type, or if the default type // is a forward reference, the empty object type is used. + const context = createFillContext(typeParameters, typeArguments); for (let i = numTypeArguments; i < numTypeParameters; i++) { - typeArguments[i] = emptyObjectType; - } - for (let i = numTypeArguments; i < numTypeParameters; i++) { - const mapper = createTypeMapper(typeParameters, typeArguments); - const defaultType = getDefaultFromTypeParameter(typeParameters[i]); - typeArguments[i] = defaultType ? instantiateType(defaultType, mapper) : emptyObjectType; + fillTypeArgument(context, i); + if (errorNode && context.failed && compilerOptions.noImplicitAny) { + error(errorNode, + Diagnostics.Type_parameter_0_implicitly_has_type_any_because_it_was_not_supplied, + typeToString(typeParameters[i])); + errorNode = undefined; + } } + + return context.typeArguments; } } return typeArguments; } + function createFillContext(typeParameters: TypeParameter[], typeArguments: Type[]): FillContext { + return { + typeParameters, + typeArguments: typeArguments || [], + }; + } + + function fillTypeArgument(context: FillContext, index: number) { + const defaultType = getDefaultFromTypeParameter(context.typeParameters[index]); + if (defaultType) { + context.failed = false; + context.typeParameterIndex = index; + context.typeArguments[index] = instantiateType(defaultType, getFillMapper(context)); + } + else { + context.failed = true; + context.typeArguments[index] = anyType; + } + } + + function getFillMapper(context: FillContext): TypeMapper { + if (!context.mapper) { + const mapper: TypeMapper = t => { + const typeParameters = context.typeParameters; + for (let i = 0; i < typeParameters.length; i++) { + if (t === typeParameters[i]) { + return getDefaultType(context, i); + } + } + }; + mapper.mappedTypes = context.typeParameters; + } + return context.mapper; + } + + function getDefaultType(context: FillContext, index: number) { + if (index < context.typeParameterIndex) { + return context.typeArguments[index]; + } + + context.failed = true; + return anyType; + } + function getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature { const links = getNodeLinks(declaration); if (!links.resolvedSignature) { @@ -5508,7 +5552,7 @@ namespace ts { } function getSignatureInstantiation(signature: Signature, typeArguments: Type[]): Signature { - typeArguments = fillMissingTypeArguments(typeArguments, signature.typeParameters, getMinTypeArgumentCount(signature.typeParameters)); + typeArguments = fillMissingTypeArguments(typeArguments, signature.typeParameters, /*errorNode*/ undefined); const instantiations = signature.instantiations || (signature.instantiations = createMap()); const id = getTypeListId(typeArguments); let instantiation = instantiations.get(id); @@ -5675,21 +5719,17 @@ namespace ts { const typeParameters = type.localTypeParameters; if (typeParameters) { const numTypeArguments = length(node.typeArguments); - const minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); - if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + if (numTypeArguments > typeParameters.length) { error(node, - minTypeArgumentCount === typeParameters.length - ? Diagnostics.Generic_type_0_requires_1_type_argument_s - : Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, + Diagnostics.Generic_type_0_requires_1_or_fewer_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), - minTypeArgumentCount, typeParameters.length); return unknownType; } // In a type reference, the outer type parameters of the referenced class or interface are automatically // supplied as type arguments and the type reference only specifies arguments for the local type parameters // of the class or interface. - const typeArguments = concatenate(type.outerTypeParameters, fillMissingTypeArguments(map(node.typeArguments, getTypeFromTypeNode), typeParameters, minTypeArgumentCount)); + const typeArguments = concatenate(type.outerTypeParameters, fillMissingTypeArguments(map(node.typeArguments, getTypeFromTypeNode), typeParameters, node)); return createTypeReference(type, typeArguments); } if (node.typeArguments) { @@ -5699,14 +5739,14 @@ namespace ts { return type; } - function getTypeAliasInstantiation(symbol: Symbol, typeArguments: Type[]): Type { + function getTypeAliasInstantiation(symbol: Symbol, typeArguments: Type[], errorNode: Node): Type { const type = getDeclaredTypeOfSymbol(symbol); const links = getSymbolLinks(symbol); const typeParameters = links.typeParameters; const id = getTypeListId(typeArguments); let instantiation = links.instantiations.get(id); if (!instantiation) { - links.instantiations.set(id, instantiation = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters))))); + links.instantiations.set(id, instantiation = instantiateTypeNoAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, errorNode)))); } return instantiation; } @@ -5719,19 +5759,15 @@ namespace ts { const typeParameters = getSymbolLinks(symbol).typeParameters; if (typeParameters) { const numTypeArguments = length(node.typeArguments); - const minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); - if (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length) { + if (numTypeArguments > typeParameters.length) { error(node, - minTypeArgumentCount === typeParameters.length - ? Diagnostics.Generic_type_0_requires_1_type_argument_s - : Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments, + Diagnostics.Generic_type_0_requires_1_or_fewer_type_argument_s, symbolToString(symbol), - minTypeArgumentCount, typeParameters.length); return unknownType; } const typeArguments = map(node.typeArguments, getTypeFromTypeNode); - return getTypeAliasInstantiation(symbol, typeArguments); + return getTypeAliasInstantiation(symbol, typeArguments, node); } if (node.typeArguments) { error(node, Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); @@ -7038,7 +7074,7 @@ namespace ts { // instantiated for T. Instead, we need to further instantiate the { x: U, t: U } form. if (type.aliasSymbol && isTopLevelTypeAlias(type.aliasSymbol)) { if (type.aliasTypeArguments) { - return getTypeAliasInstantiation(type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + return getTypeAliasInstantiation(type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper), /*errorNode*/ undefined); } return type; } @@ -13712,7 +13748,7 @@ namespace ts { if (candidate.typeParameters) { let typeArgumentTypes: Type[] | undefined; if (typeArguments) { - typeArgumentTypes = fillMissingTypeArguments(map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, getMinTypeArgumentCount(candidate.typeParameters)); + typeArgumentTypes = fillMissingTypeArguments(map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, /*errorNode*/ undefined); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false); } else { @@ -16277,7 +16313,6 @@ namespace ts { } function checkTypeArgumentConstraints(typeParameters: TypeParameter[], typeArgumentNodes: TypeNode[]): boolean { - const minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); let typeArguments: Type[]; let mapper: TypeMapper; let result = true; @@ -16285,7 +16320,7 @@ namespace ts { const constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = fillMissingTypeArguments(map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount); + typeArguments = fillMissingTypeArguments(map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, /*errorNode*/ undefined); mapper = createTypeMapper(typeParameters, typeArguments); } const typeArgument = typeArguments[i]; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a3aba6fd3372a..3e74269098166 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -915,7 +915,7 @@ "category": "Error", "code": 2313 }, - "Generic type '{0}' requires {1} type argument(s).": { + "Generic type '{0}' requires {1} or fewer type argument(s).": { "category": "Error", "code": 2314 }, @@ -2051,9 +2051,9 @@ "category": "Error", "code": 2705 }, - "Generic type '{0}' requires between {1} and {2} type arguments.": { + "Type parameter '{0}' implicitly has type 'any' because it was not supplied.": { "category": "Error", - "code": 2707 + "code": 2706 }, "Import declaration '{0}' is using private name '{1}'.": { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 8010cc7dcb01f..136932f524fa1 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3135,6 +3135,15 @@ // It is optional because in contextual signature instantiation, nothing fails } + /* @internal */ + export interface FillContext { + typeParameters: TypeParameter[]; // Type parameters for which defaults are filled + typeParameterIndex?: number; // Index of the type parameter being filled. + typeArguments: Type[]; // Filled type arguments for each type parameter. + mapper?: TypeMapper; // Type mapper for this fill context + failed?: boolean; // Indicates whether the current type parameter failed. + } + /* @internal */ export const enum SpecialPropertyAssignmentKind { None, From 7796d68c539b6742b15ee0c16ff3716a00a608d6 Mon Sep 17 00:00:00 2001 From: rbuckton Date: Wed, 1 Mar 2017 00:03:38 -0800 Subject: [PATCH 2/3] Make unsatisfied type arguments implictly any --- src/compiler/checker.ts | 2 +- ...AndArrayConstructorEquivalence1.errors.txt | 12 +- ...yLiteralAndArrayConstructorEquivalence1.js | 8 +- .../arrayReferenceWithoutTypeArgs.errors.txt | 4 +- .../emptyGenericParamList.errors.txt | 4 +- ...rnalModuleExportingGenericClass.errors.txt | 4 +- ...ericArrayAssignmentCompatErrors.errors.txt | 14 +- .../genericArrayAssignmentCompatErrors.js | 10 +- ...nericArrayWithoutTypeAnnotation.errors.txt | 4 +- .../genericCloduleInModule2.errors.txt | 4 +- tests/baselines/reference/genericDefaults.js | 4 +- .../baselines/reference/genericDefaults.types | 54 +++--- .../genericDefaultsErrors.errors.txt | 12 +- .../reference/genericGetter2.errors.txt | 4 +- ...cInterfacesWithoutTypeArguments.errors.txt | 8 +- ...ricLambaArgWithoutTypeArguments.errors.txt | 12 +- ...rsiveImplicitConstructorErrors1.errors.txt | 14 +- ...ericRecursiveImplicitConstructorErrors1.js | 2 +- ...rsiveImplicitConstructorErrors3.errors.txt | 84 ++++++-- ...ericRecursiveImplicitConstructorErrors3.js | 4 +- .../genericReturnTypeFromGetter1.errors.txt | 4 +- ...eReferenceWithoutTypeArgument.d.errors.txt | 58 +++--- ...ypeReferenceWithoutTypeArgument.errors.txt | 94 ++++----- ...genericTypeReferenceWithoutTypeArgument.js | 4 +- ...peReferenceWithoutTypeArgument2.errors.txt | 78 ++++---- ...enericTypeReferenceWithoutTypeArgument2.js | 4 +- ...peReferenceWithoutTypeArgument3.errors.txt | 58 +++--- ...enericTypeReferenceWithoutTypeArgument3.js | 4 +- ...icTypeReferencesRequireTypeArgs.errors.txt | 16 +- ...icTypeUsedWithoutTypeArguments1.errors.txt | 4 +- ...icTypeUsedWithoutTypeArguments3.errors.txt | 4 +- .../baselines/reference/generics1.errors.txt | 13 +- .../baselines/reference/generics2.errors.txt | 13 +- .../genericsWithoutTypeParameters1.errors.txt | 60 +++--- .../missingTypeArguments1.errors.txt | 46 ++--- .../reference/missingTypeArguments1.js | 6 +- .../missingTypeArguments2.errors.txt | 16 +- .../noTypeArgumentOnReturnType1.errors.txt | 6 +- .../reference/noTypeArgumentOnReturnType1.js | 2 +- ...cursiveBaseConstructorCreation3.errors.txt | 4 +- ...onstraintReferenceLacksTypeArgs.errors.txt | 4 +- .../returnTypeTypeArguments.errors.txt | 180 ++++++++++-------- ...IncorrectNumberOfTypeArguments1.errors.txt | 12 +- ...ericTypeButWithNoTypeArguments1.errors.txt | 15 +- .../tooManyTypeParameters1.errors.txt | 4 +- .../typeAliasDeclarationEmit.errors.txt | 4 +- ...yLiteralAndArrayConstructorEquivalence1.ts | 9 +- .../compiler/arrayReferenceWithoutTypeArgs.ts | 1 + tests/cases/compiler/emptyGenericParamList.ts | 1 + .../externalModuleExportingGenericClass.ts | 1 + .../genericArrayAssignmentCompatErrors.ts | 41 ++-- .../genericArrayWithoutTypeAnnotation.ts | 1 + .../cases/compiler/genericCloduleInModule2.ts | 1 + tests/cases/compiler/genericGetter2.ts | 1 + .../genericInterfacesWithoutTypeArguments.ts | 1 + .../genericLambaArgWithoutTypeArguments.ts | 1 + ...ericRecursiveImplicitConstructorErrors1.ts | 3 +- ...ericRecursiveImplicitConstructorErrors3.ts | 5 +- .../compiler/genericReturnTypeFromGetter1.ts | 1 + .../genericTypeReferencesRequireTypeArgs.ts | 1 + .../genericTypeUsedWithoutTypeArguments1.ts | 1 + .../genericTypeUsedWithoutTypeArguments3.ts | 1 + tests/cases/compiler/generics1.ts | 29 +-- tests/cases/compiler/generics2.ts | 43 +++-- .../genericsWithoutTypeParameters1.ts | 1 + tests/cases/compiler/missingTypeArguments1.ts | 7 +- tests/cases/compiler/missingTypeArguments2.ts | 1 + .../compiler/noTypeArgumentOnReturnType1.ts | 3 +- .../recursiveBaseConstructorCreation3.ts | 1 + ...rameterConstraintReferenceLacksTypeArgs.ts | 1 + .../cases/compiler/returnTypeTypeArguments.ts | 1 + ...eButWithIncorrectNumberOfTypeArguments1.ts | 1 + ...sFromGenericTypeButWithNoTypeArguments1.ts | 1 + .../compiler/typeAliasDeclarationEmit.ts | 1 + ...nericTypeReferenceWithoutTypeArgument.d.ts | 3 +- ...genericTypeReferenceWithoutTypeArgument.ts | 3 +- ...enericTypeReferenceWithoutTypeArgument2.ts | 3 +- ...enericTypeReferenceWithoutTypeArgument3.ts | 3 +- 78 files changed, 652 insertions(+), 497 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 769967e3c676d..6e044b55c8e0a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5396,7 +5396,6 @@ namespace ts { error(errorNode, Diagnostics.Type_parameter_0_implicitly_has_type_any_because_it_was_not_supplied, typeToString(typeParameters[i])); - errorNode = undefined; } } @@ -5437,6 +5436,7 @@ namespace ts { } }; mapper.mappedTypes = context.typeParameters; + context.mapper = mapper; } return context.mapper; } diff --git a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt index 75a69c09df808..a78a7022ce927 100644 --- a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt +++ b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.errors.txt @@ -1,19 +1,19 @@ -tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts(3,14): error TS2314: Generic type 'Array' requires 1 type argument(s). +tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts(3,14): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts (1 errors) ==== - var myCars=new Array(); + var myCars=new Array(); var myCars3 = new Array({}); var myCars4: Array; // error ~~~~~ -!!! error TS2314: Generic type 'Array' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var myCars5: Array[]; - + myCars = myCars3; myCars = myCars4; myCars = myCars5; - + myCars3 = myCars; myCars3 = myCars4; - myCars3 = myCars5; + myCars3 = myCars5; \ No newline at end of file diff --git a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js index 0b9f543e38242..88207a3132021 100644 --- a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js +++ b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js @@ -1,16 +1,16 @@ //// [arrayLiteralAndArrayConstructorEquivalence1.ts] -var myCars=new Array(); +var myCars=new Array(); var myCars3 = new Array({}); var myCars4: Array; // error var myCars5: Array[]; - + myCars = myCars3; myCars = myCars4; myCars = myCars5; - + myCars3 = myCars; myCars3 = myCars4; -myCars3 = myCars5; +myCars3 = myCars5; //// [arrayLiteralAndArrayConstructorEquivalence1.js] diff --git a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt index f662bf20af3e3..9dc714126eb5c 100644 --- a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt +++ b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts(2,17): error TS2314: Generic type 'Array' requires 1 type argument(s). +tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts(2,17): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts (1 errors) ==== class X { public f(a: Array) { } ~~~~~ -!!! error TS2314: Generic type 'Array' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } \ No newline at end of file diff --git a/tests/baselines/reference/emptyGenericParamList.errors.txt b/tests/baselines/reference/emptyGenericParamList.errors.txt index ed1046d0f4949..29cc31fa035aa 100644 --- a/tests/baselines/reference/emptyGenericParamList.errors.txt +++ b/tests/baselines/reference/emptyGenericParamList.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/emptyGenericParamList.ts(2,8): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/emptyGenericParamList.ts(2,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/compiler/emptyGenericParamList.ts(2,9): error TS1099: Type argument list cannot be empty. @@ -6,6 +6,6 @@ tests/cases/compiler/emptyGenericParamList.ts(2,9): error TS1099: Type argument class I {} var x: I<>; ~~~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~~ !!! error TS1099: Type argument list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt b/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt index 7825345a1b57f..15cd3c6140f92 100644 --- a/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt +++ b/tests/baselines/reference/externalModuleExportingGenericClass.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/externalModuleExportingGenericClass_file1.ts(2,8): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/compiler/externalModuleExportingGenericClass_file1.ts(2,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/externalModuleExportingGenericClass_file1.ts (1 errors) ==== import a = require('./externalModuleExportingGenericClass_file0'); var v: a; // this should report error ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var v2: any = (new a()).foo; var v3: number = (new a()).foo; diff --git a/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt b/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt index 02ac17bb10cd7..f75da659accb4 100644 --- a/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt +++ b/tests/baselines/reference/genericArrayAssignmentCompatErrors.errors.txt @@ -1,30 +1,30 @@ tests/cases/compiler/genericArrayAssignmentCompatErrors.ts(2,15): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. -tests/cases/compiler/genericArrayAssignmentCompatErrors.ts(4,14): error TS2314: Generic type 'Array' requires 1 type argument(s). +tests/cases/compiler/genericArrayAssignmentCompatErrors.ts(4,14): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/genericArrayAssignmentCompatErrors.ts (2 errors) ==== - var myCars=new Array(); + var myCars=new Array(); var myCars2 = new []; ~~~~~~ !!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. var myCars3 = new Array({}); var myCars4: Array; // error ~~~~~ -!!! error TS2314: Generic type 'Array' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var myCars5: Array[]; - + myCars = myCars2; myCars = myCars3; myCars = myCars4; myCars = myCars5; - + myCars2 = myCars; myCars2 = myCars3; myCars2 = myCars4; myCars2 = myCars5; - + myCars3 = myCars; myCars3 = myCars2; myCars3 = myCars4; - myCars3 = myCars5; + myCars3 = myCars5; \ No newline at end of file diff --git a/tests/baselines/reference/genericArrayAssignmentCompatErrors.js b/tests/baselines/reference/genericArrayAssignmentCompatErrors.js index 8006ced4f1f71..c23a017a4c974 100644 --- a/tests/baselines/reference/genericArrayAssignmentCompatErrors.js +++ b/tests/baselines/reference/genericArrayAssignmentCompatErrors.js @@ -1,24 +1,24 @@ //// [genericArrayAssignmentCompatErrors.ts] -var myCars=new Array(); +var myCars=new Array(); var myCars2 = new []; var myCars3 = new Array({}); var myCars4: Array; // error var myCars5: Array[]; - + myCars = myCars2; myCars = myCars3; myCars = myCars4; myCars = myCars5; - + myCars2 = myCars; myCars2 = myCars3; myCars2 = myCars4; myCars2 = myCars5; - + myCars3 = myCars; myCars3 = myCars2; myCars3 = myCars4; -myCars3 = myCars5; +myCars3 = myCars5; //// [genericArrayAssignmentCompatErrors.js] diff --git a/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt index dcb0de1cbb5b0..8c716bb6bf199 100644 --- a/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt +++ b/tests/baselines/reference/genericArrayWithoutTypeAnnotation.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts(4,24): error TS2314: Generic type 'IFoo' requires 1 type argument(s). +tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts(4,24): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts (1 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts(4,24): error TS2314: G class Bar { public getBar(foo: IFoo[]) { ~~~~ -!!! error TS2314: Generic type 'IFoo' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } } \ No newline at end of file diff --git a/tests/baselines/reference/genericCloduleInModule2.errors.txt b/tests/baselines/reference/genericCloduleInModule2.errors.txt index 6b8ec9012f03d..f63fa252b52f8 100644 --- a/tests/baselines/reference/genericCloduleInModule2.errors.txt +++ b/tests/baselines/reference/genericCloduleInModule2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericCloduleInModule2.ts(14,8): error TS2314: Generic type 'B' requires 1 type argument(s). +tests/cases/compiler/genericCloduleInModule2.ts(14,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/genericCloduleInModule2.ts (1 errors) ==== @@ -17,5 +17,5 @@ tests/cases/compiler/genericCloduleInModule2.ts(14,8): error TS2314: Generic typ var b: A.B; ~~~ -!!! error TS2314: Generic type 'B' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. b.foo(); \ No newline at end of file diff --git a/tests/baselines/reference/genericDefaults.js b/tests/baselines/reference/genericDefaults.js index 45d889fc49c5a..64b1b1dea6deb 100644 --- a/tests/baselines/reference/genericDefaults.js +++ b/tests/baselines/reference/genericDefaults.js @@ -936,12 +936,12 @@ interface i04 { interface i05 { a: T; } -declare const i05c00: {}; +declare const i05c00: any; declare const i05c01: number; interface i06 { a: [T, U]; } -declare const i06c00: [{}, {}]; +declare const i06c00: [any, any]; declare const i06c01: [number, number]; declare const i06c02: [number, string]; interface i07 { diff --git a/tests/baselines/reference/genericDefaults.types b/tests/baselines/reference/genericDefaults.types index cd6c2d58e4acf..7fed1e69f32e8 100644 --- a/tests/baselines/reference/genericDefaults.types +++ b/tests/baselines/reference/genericDefaults.types @@ -1296,25 +1296,25 @@ f14(a, b, d); // no inference, partially supplied f14(); ->f14() : [A, {}, C] +>f14() : [A, any, C] >f14 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A f14(a); ->f14(a) : [A, {}, C] +>f14(a) : [A, any, C] >f14 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A f14(a, b); ->f14(a, b) : [A, {}, C] +>f14(a, b) : [A, any, C] >f14 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A >b : B f14(a, b, c); ->f14(a, b, c) : [A, {}, C] +>f14(a, b, c) : [A, any, C] >f14 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A @@ -1500,25 +1500,25 @@ f16(a, b, b); // no inference, partially supplied f16(); ->f16() : [A, {}, {}] +>f16() : [A, any, any] >f16 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A f16(a); ->f16(a) : [A, {}, {}] +>f16(a) : [A, any, any] >f16 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A f16(a, b); ->f16(a, b) : [A, {}, {}] +>f16(a, b) : [A, any, any] >f16 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A >b : B f16(a, b, b); ->f16(a, b, b) : [A, {}, {}] +>f16(a, b, b) : [A, any, any] >f16 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A @@ -1732,25 +1732,25 @@ f18(a, b, c); // no inference, partially supplied f18(); ->f18() : [A, {}, {} | C] +>f18() : [A, any, any] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A f18(a); ->f18(a) : [A, {}, {} | C] +>f18(a) : [A, any, any] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A f18(a, b); ->f18(a, b) : [A, {}, {} | C] +>f18(a, b) : [A, any, any] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A >b : B f18(a, b, b); ->f18(a, b, b) : [A, {}, {} | C] +>f18(a, b, b) : [A, any, any] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A @@ -1758,7 +1758,7 @@ f18(a, b, b); >b : B f18(a, b, c); ->f18(a, b, c) : [A, {}, {} | C] +>f18(a, b, c) : [A, any, any] >f18 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A @@ -1973,25 +1973,25 @@ f20(a, b, c); // no inference, partially supplied f20(); ->f20() : [A, {}, {} & C] +>f20() : [A, any, any] >f20 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A f20(a); ->f20(a) : [A, {}, {} & C] +>f20(a) : [A, any, any] >f20 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A f20(a, b); ->f20(a, b) : [A, {}, {} & C] +>f20(a, b) : [A, any, any] >f20 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A >b : B f20(a, b, bc); ->f20(a, b, bc) : [A, {}, {} & C] +>f20(a, b, bc) : [A, any, any] >f20 : (a?: T, b?: U, c?: V) => [T, U, V] >A : A >a : A @@ -2247,13 +2247,13 @@ interface i05 { a: T; } >T : T const i05c00 = (x).a; ->i05c00 : {} ->(x).a : {} ->(x) : i05<{}> ->x : i05<{}> +>i05c00 : any +>(x).a : any +>(x) : i05 +>x : i05 >i05 : i05 >x : any ->a : {} +>a : any const i05c01 = (>x).a; >i05c01 : number @@ -2275,13 +2275,13 @@ interface i06 { a: [T, U]; } >U : U const i06c00 = (x).a; ->i06c00 : [{}, {}] ->(x).a : [{}, {}] ->(x) : i06<{}, {}> ->x : i06<{}, {}> +>i06c00 : [any, any] +>(x).a : [any, any] +>(x) : i06 +>x : i06 >i06 : i06 >x : any ->a : [{}, {}] +>a : [any, any] const i06c01 = (>x).a; >i06c01 : [number, number] diff --git a/tests/baselines/reference/genericDefaultsErrors.errors.txt b/tests/baselines/reference/genericDefaultsErrors.errors.txt index 03769586b413f..57935ec098b91 100644 --- a/tests/baselines/reference/genericDefaultsErrors.errors.txt +++ b/tests/baselines/reference/genericDefaultsErrors.errors.txt @@ -16,14 +16,12 @@ tests/cases/compiler/genericDefaultsErrors.ts(28,52): error TS2344: Type 'T' doe Type 'string' is not assignable to type 'number'. tests/cases/compiler/genericDefaultsErrors.ts(29,37): error TS2344: Type 'T' does not satisfy the constraint 'number'. tests/cases/compiler/genericDefaultsErrors.ts(30,32): error TS2344: Type 'number' does not satisfy the constraint 'T'. -tests/cases/compiler/genericDefaultsErrors.ts(33,15): error TS2707: Generic type 'i09' requires between 2 and 3 type arguments. -tests/cases/compiler/genericDefaultsErrors.ts(34,15): error TS2707: Generic type 'i09' requires between 2 and 3 type arguments. -tests/cases/compiler/genericDefaultsErrors.ts(37,15): error TS2707: Generic type 'i09' requires between 2 and 3 type arguments. +tests/cases/compiler/genericDefaultsErrors.ts(37,15): error TS2314: Generic type 'i09' requires 3 or fewer type argument(s). tests/cases/compiler/genericDefaultsErrors.ts(39,20): error TS2304: Cannot find name 'T'. tests/cases/compiler/genericDefaultsErrors.ts(39,20): error TS4033: Property 'x' of exported interface has or is using private name 'T'. -==== tests/cases/compiler/genericDefaultsErrors.ts (21 errors) ==== +==== tests/cases/compiler/genericDefaultsErrors.ts (19 errors) ==== declare const x: any; @@ -91,16 +89,12 @@ tests/cases/compiler/genericDefaultsErrors.ts(39,20): error TS4033: Property 'x' interface i09 { } type i09t00 = i09; // error - ~~~ -!!! error TS2707: Generic type 'i09' requires between 2 and 3 type arguments. type i09t01 = i09<1>; // error - ~~~~~~ -!!! error TS2707: Generic type 'i09' requires between 2 and 3 type arguments. type i09t02 = i09<1, 2>; // ok type i09t03 = i09<1, 2, 3>; // ok type i09t04 = i09<1, 2, 3, 4>; // error ~~~~~~~~~~~~~~~ -!!! error TS2707: Generic type 'i09' requires between 2 and 3 type arguments. +!!! error TS2314: Generic type 'i09' requires 3 or fewer type argument(s). interface i10 { x: T; } // error ~ diff --git a/tests/baselines/reference/genericGetter2.errors.txt b/tests/baselines/reference/genericGetter2.errors.txt index 586ae56f60628..fb6fb9617409f 100644 --- a/tests/baselines/reference/genericGetter2.errors.txt +++ b/tests/baselines/reference/genericGetter2.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/genericGetter2.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -tests/cases/compiler/genericGetter2.ts(5,14): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/genericGetter2.ts(5,14): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/genericGetter2.ts (2 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/genericGetter2.ts(5,14): error TS2314: Generic type 'A' ~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. ~ -!!! error TS2314: Generic type 'A' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. return this.data; } } \ No newline at end of file diff --git a/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt index b81230b440db2..717da9bc21e3b 100644 --- a/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt +++ b/tests/baselines/reference/genericInterfacesWithoutTypeArguments.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(3,8): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(4,10): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(3,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(4,10): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts (2 errors) ==== @@ -7,8 +7,8 @@ tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts(4,10): error TS231 class C { } var i: I; ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var c: C; ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt index 4348c1cf9c4d5..d97d040191b63 100644 --- a/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt +++ b/tests/baselines/reference/genericLambaArgWithoutTypeArguments.errors.txt @@ -1,14 +1,20 @@ -tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts(7,11): error TS2314: Generic type 'Foo' requires 1 type argument(s). +tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts(4,10): error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts(4,14): error TS7006: Parameter 'a' implicitly has an 'any' type. +tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts(7,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. -==== tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts (1 errors) ==== +==== tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts (3 errors) ==== interface Foo { x: T; } function foo(a) { + ~~~ +!!! error TS7010: 'foo', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! error TS7006: Parameter 'a' implicitly has an 'any' type. return null; } foo((arg: Foo) => { return arg.x; }); ~~~ -!!! error TS2314: Generic type 'Foo' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt index a76eb9d233d78..ae04fa42ed37d 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.errors.txt @@ -1,7 +1,9 @@ -tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts(9,49): error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). +tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts(9,49): error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts(9,49): error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts(9,49): error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. -==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts (1 errors) ==== +==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts (3 errors) ==== export declare module TypeScript { class PullSymbol { } class PullSignatureSymbol extends PullSymbol { @@ -12,8 +14,12 @@ tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts(9,49): error } class PullTypeParameterSymbol extends PullTypeSymbol { ~~~~~~~~~~~~~~ -!!! error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). +!!! error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~~~~~ +!!! error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~~~~~ +!!! error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. } } - + \ No newline at end of file diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.js index 49debc2ca8450..4bc9b18943ecf 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors1.js @@ -10,7 +10,7 @@ export declare module TypeScript { class PullTypeParameterSymbol extends PullTypeSymbol { } } - + //// [genericRecursiveImplicitConstructorErrors1.js] diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt index 1a04e356296c9..0244a9869aa40 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.errors.txt @@ -1,54 +1,108 @@ -tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2314: Generic type 'MemberName' requires 3 type argument(s). -tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(10,22): error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). -tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(12,48): error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). -tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(13,31): error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). -tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(14,46): error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). -tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(18,53): error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(3,66): error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(10,22): error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(10,22): error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(10,22): error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(12,48): error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(12,48): error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(12,48): error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(13,31): error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(13,31): error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(13,31): error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(14,46): error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(14,46): error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(14,46): error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(18,16): error TS7023: 'getScopedNameEx' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(18,53): error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(18,53): error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(18,53): error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(19,22): error TS2339: Property 'isArray' does not exist on type 'PullTypeSymbol'. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(20,21): error TS7022: 'elementMemberName' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(21,36): error TS2339: Property 'isArray' does not exist on type 'PullTypeSymbol'. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(21,67): error TS2339: Property 'isNamedTypeSymbol' does not exist on type 'PullTypeSymbol'. +tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts(23,35): error TS2339: Property 'getMemberTypeNameEx' does not exist on type 'PullTypeSymbol'. -==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts (7 errors) ==== +==== tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts (25 errors) ==== module TypeScript { export class MemberName { static create(arg1: any, arg2?: any, arg3?: any): MemberName { ~~~~~~~~~~ -!!! error TS2314: Generic type 'MemberName' requires 3 type argument(s). +!!! error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. + ~~~~~~~~~~ +!!! error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~ +!!! error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~ +!!! error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. } } } - + module TypeScript { export class PullSymbol { public type: PullTypeSymbol = null; ~~~~~~~~~~~~~~ -!!! error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). +!!! error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~~~~~ +!!! error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~~~~~ +!!! error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. } export class PullTypeSymbol extends PullSymbol { ~~~~~~~~~~ -!!! error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). +!!! error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~ +!!! error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~ +!!! error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. private _elementType: PullTypeSymbol = null; ~~~~~~~~~~~~~~ -!!! error TS2314: Generic type 'PullTypeSymbol' requires 3 type argument(s). +!!! error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~~~~~ +!!! error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~~~~~ +!!! error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. public toString(scopeSymbol?: PullSymbol, useConstraintInName?: boolean) { ~~~~~~~~~~ -!!! error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). +!!! error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~ +!!! error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~ +!!! error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. var s = this.getScopedNameEx(scopeSymbol, useConstraintInName).toString(); return s; } public getScopedNameEx(scopeSymbol?: PullSymbol, useConstraintInName?: boolean, getPrettyTypeName?: boolean, getTypeParamMarkerInfo?: boolean) { + ~~~~~~~~~~~~~~~ +!!! error TS7023: 'getScopedNameEx' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. + ~~~~~~~~~~ +!!! error TS2707: Type parameter 'A' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~ +!!! error TS2707: Type parameter 'B' implicitly has type 'any' because it was not supplied. ~~~~~~~~~~ -!!! error TS2314: Generic type 'PullSymbol' requires 3 type argument(s). +!!! error TS2707: Type parameter 'C' implicitly has type 'any' because it was not supplied. if (this.isArray()) { ~~~~~~~ !!! error TS2339: Property 'isArray' does not exist on type 'PullTypeSymbol'. var elementMemberName = this._elementType ? + ~~~~~~~~~~~~~~~~~ +!!! error TS7022: 'elementMemberName' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. (this._elementType.isArray() || this._elementType.isNamedTypeSymbol() ? + ~~~~~~~ +!!! error TS2339: Property 'isArray' does not exist on type 'PullTypeSymbol'. + ~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'isNamedTypeSymbol' does not exist on type 'PullTypeSymbol'. this._elementType.getScopedNameEx(scopeSymbol, false, getPrettyTypeName, getTypeParamMarkerInfo) : this._elementType.getMemberTypeNameEx(false, scopeSymbol, getPrettyTypeName)) : 1 + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'getMemberTypeNameEx' does not exist on type 'PullTypeSymbol'. return MemberName.create(elementMemberName, "", "[]"); } } } } - + \ No newline at end of file diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index d0bf08113d2e3..48e7e9d751da1 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -5,7 +5,7 @@ module TypeScript { } } } - + module TypeScript { export class PullSymbol { public type: PullTypeSymbol = null; @@ -27,7 +27,7 @@ module TypeScript { } } } - + //// [genericRecursiveImplicitConstructorErrors3.js] diff --git a/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt b/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt index 6f5f68064a6a6..00f9ac8708add 100644 --- a/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt +++ b/tests/baselines/reference/genericReturnTypeFromGetter1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/genericReturnTypeFromGetter1.ts(5,18): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/genericReturnTypeFromGetter1.ts(5,18): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/compiler/genericReturnTypeFromGetter1.ts(6,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -9,7 +9,7 @@ tests/cases/compiler/genericReturnTypeFromGetter1.ts(6,7): error TS1056: Accesso export class DbSet { _entityType: A; ~ -!!! error TS2314: Generic type 'A' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. get entityType() { return this._entityType; } // used to ICE without return type annotation ~~~~~~~~~~ !!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt index 2f6db48bf2fa4..eb8f948955bad 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.d.errors.txt @@ -1,22 +1,24 @@ -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(8,16): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(10,21): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,22): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,26): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(8,16): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(10,21): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(11,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'. -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,22): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,26): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,23): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,27): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(16,25): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(12,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,23): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(14,27): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(16,25): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(22,28): error TS2339: Property 'C' does not exist on type 'typeof M'. -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(23,28): error TS2314: Generic type 'E' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(25,30): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(26,30): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(23,28): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(25,18): error TS7010: 'h', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(25,30): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(26,18): error TS7010: 'i', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts(26,30): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. -==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts (14 errors) ==== +==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts (16 errors) ==== // it is an error to use a generic type without type arguments - // all of these are errors + // all of these are errors declare class C { foo: T; @@ -24,33 +26,33 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc declare var c: C; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare var a: { x: C }; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare var b: { (x: C): C }; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare var d: { [x: C]: C }; ~ !!! error TS1023: An index signature parameter type must be 'string' or 'number'. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare function f(x: C): C; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare class D extends C {} ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare module M { export class E { foo: T } @@ -61,11 +63,15 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc !!! error TS2339: Property 'C' does not exist on type 'typeof M'. declare class D3 { } ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare function h(x: T); + ~ +!!! error TS7010: 'h', which lacks return-type annotation, implicitly has an 'any' return type. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare function i(x: T); + ~ +!!! error TS7010: 'i', which lacks return-type annotation, implicitly has an 'any' return type. ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). \ No newline at end of file +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt index d57f3c2fc0d03..65a8f74d38b37 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.errors.txt @@ -1,32 +1,32 @@ -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(8,8): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(10,13): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,14): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,18): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(8,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(10,13): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,14): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(11,18): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'. -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,14): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,18): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(14,13): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(14,28): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(16,15): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(16,19): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(16,30): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(18,23): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(18,27): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(18,38): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(20,17): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(23,21): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(29,18): error TS2314: Generic type 'E' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(30,20): error TS2314: Generic type 'E' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(31,22): error TS2314: Generic type 'E' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(33,22): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(34,22): error TS2314: Generic type 'E' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(36,10): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(37,10): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,14): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(12,18): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(14,13): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(14,28): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(16,15): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(16,19): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(16,30): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(18,23): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(18,27): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(18,38): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(20,17): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(23,21): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(29,18): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(30,20): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(31,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(33,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(34,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(36,10): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts(37,10): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts (24 errors) ==== // it is an error to use a generic type without type arguments - // all of these are errors + // all of these are errors class C { foo: T; @@ -34,54 +34,54 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc var c: C; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var a: { x: C }; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var b: { (x: C): C }; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var d: { [x: C]: C }; ~ !!! error TS1023: An index signature parameter type must be 'string' or 'number'. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var e = (x: C) => { var y: C; return y; } ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. function f(x: C): C { var y: C; return y; } ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var g = function f(x: C): C { var y: C; return y; } ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. class D extends C { ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } interface I extends C {} ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. module M { export class E { foo: T } @@ -89,24 +89,24 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc class D2 extends M.E { } ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. class D3 { } ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. interface I2 extends M.E { } ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. function h(x: T) { } ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. function i(x: T) { } ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var j = null; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var k = null; ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). \ No newline at end of file +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js index 8fc00dcc08f78..40236111a1e17 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js @@ -1,6 +1,6 @@ //// [genericTypeReferenceWithoutTypeArgument.ts] // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors class C { foo: T; @@ -39,7 +39,7 @@ var k = null; //// [genericTypeReferenceWithoutTypeArgument.js] // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt index 7635608f58edd..32dda925865d0 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.errors.txt @@ -1,32 +1,32 @@ -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(8,8): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(10,13): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,14): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,18): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(8,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(10,13): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,14): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(11,18): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,11): error TS1023: An index signature parameter type must be 'string' or 'number'. -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,14): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,18): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(14,13): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(14,28): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(16,15): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(16,19): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(16,30): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,23): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,27): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,38): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,14): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(12,18): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(14,13): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(14,28): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(16,15): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(16,19): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(16,30): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,23): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,27): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(18,38): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(20,17): error TS2689: Cannot extend an interface 'I'. Did you mean 'implements'? -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(23,21): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(23,21): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(29,18): error TS2304: Cannot find name 'M'. -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(30,24): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(30,24): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(31,24): error TS2694: Namespace 'M' has no exported member 'C'. -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(33,22): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(34,22): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(33,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(34,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(36,10): error TS2304: Cannot find name 'C'. -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(37,10): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts(37,10): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts (24 errors) ==== // it is an error to use a generic type without type arguments - // all of these are errors + // all of these are errors interface I { foo: T; @@ -34,45 +34,45 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc var c: I; ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var a: { x: I }; ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var b: { (x: I): I }; ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var d: { [x: I]: I }; ~ !!! error TS1023: An index signature parameter type must be 'string' or 'number'. ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var e = (x: I) => { var y: I; return y; } ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. function f(x: I): I { var y: I; return y; } ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var g = function f(x: I): I { var y: I; return y; } ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. class D extends I { ~ @@ -81,7 +81,7 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc interface U extends I {} ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. module M { export interface E { foo: T } @@ -92,21 +92,21 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc !!! error TS2304: Cannot find name 'M'. interface D3 { } ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. interface I2 extends M.C { } ~ !!! error TS2694: Namespace 'M' has no exported member 'C'. function h(x: T) { } ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. function i(x: T) { } ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var j = null; ~ !!! error TS2304: Cannot find name 'C'. var k = null; ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). \ No newline at end of file +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js index 9730afdee04d8..0e7f610e4f20f 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js @@ -1,6 +1,6 @@ //// [genericTypeReferenceWithoutTypeArgument2.ts] // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors interface I { foo: T; @@ -39,7 +39,7 @@ var k = null; //// [genericTypeReferenceWithoutTypeArgument2.js] // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt index 95857c925be91..9e21ae177d91b 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.errors.txt @@ -1,22 +1,24 @@ -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(8,16): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(10,21): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,22): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,26): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(8,16): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(10,21): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(11,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,19): error TS1023: An index signature parameter type must be 'string' or 'number'. -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,22): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,26): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,23): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,27): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(16,25): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(12,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,23): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(14,27): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(16,25): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(22,28): error TS2339: Property 'C' does not exist on type 'typeof M'. -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(23,28): error TS2314: Generic type 'E' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(25,30): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(26,30): error TS2314: Generic type 'E' requires 1 type argument(s). +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(23,28): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(25,18): error TS7010: 'h', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(25,30): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(26,18): error TS7010: 'i', which lacks return-type annotation, implicitly has an 'any' return type. +tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts(26,30): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. -==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts (14 errors) ==== +==== tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts (16 errors) ==== // it is an error to use a generic type without type arguments - // all of these are errors + // all of these are errors declare class C { foo: T; @@ -24,33 +26,33 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc declare var c: C; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare var a: { x: C }; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare var b: { (x: C): C }; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare var d: { [x: C]: C }; ~ !!! error TS1023: An index signature parameter type must be 'string' or 'number'. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare function f(x: C): C; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare class D extends C {} ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare module M { export class E { foo: T } @@ -61,11 +63,15 @@ tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenc !!! error TS2339: Property 'C' does not exist on type 'typeof M'. declare class D3 { } ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare function h(x: T); + ~ +!!! error TS7010: 'h', which lacks return-type annotation, implicitly has an 'any' return type. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. declare function i(x: T); + ~ +!!! error TS7010: 'i', which lacks return-type annotation, implicitly has an 'any' return type. ~~~ -!!! error TS2314: Generic type 'E' requires 1 type argument(s). \ No newline at end of file +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.js index a56ec43d7c39e..b37ac55f3d6c3 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument3.js @@ -1,6 +1,6 @@ //// [genericTypeReferenceWithoutTypeArgument3.ts] // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors declare class C { foo: T; @@ -28,4 +28,4 @@ declare function i(x: T); //// [genericTypeReferenceWithoutTypeArgument3.js] // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors diff --git a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt index 224e5e038da66..04513e9215ffc 100644 --- a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt +++ b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(7,9): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(8,9): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(9,11): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(10,11): error TS2314: Generic type 'C' requires 1 type argument(s). +tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(7,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(8,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(9,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(10,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts (4 errors) ==== @@ -13,14 +13,14 @@ tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts(10,11): error TS231 } var c1: C; // error ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var i1: I; // error ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var c2: C; // should be an error ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var i2: I; // should be an error ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt index 836f250f5fc85..5694ac6a23257 100644 --- a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt +++ b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts(2,25): error TS2314: Generic type 'Foo' requires 1 type argument(s). +tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts(2,25): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts (1 errors) ==== interface Foo { } class Bar implements Foo { } ~~~ -!!! error TS2314: Generic type 'Foo' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt index c76133014f0b3..cb474faeb8c22 100644 --- a/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt +++ b/tests/baselines/reference/genericTypeUsedWithoutTypeArguments3.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts(2,26): error TS2314: Generic type 'Foo' requires 1 type argument(s). +tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts(2,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts (1 errors) ==== interface Foo { } interface Bar extends Foo { } ~~~ -!!! error TS2314: Generic type 'Foo' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/generics1.errors.txt b/tests/baselines/reference/generics1.errors.txt index 6279c0dcd6332..668d08ec0b7de 100644 --- a/tests/baselines/reference/generics1.errors.txt +++ b/tests/baselines/reference/generics1.errors.txt @@ -1,10 +1,11 @@ tests/cases/compiler/generics1.ts(10,14): error TS2344: Type 'A' does not satisfy the constraint 'B'. Property 'b' is missing in type 'A'. -tests/cases/compiler/generics1.ts(13,9): error TS2314: Generic type 'G' requires 2 type argument(s). -tests/cases/compiler/generics1.ts(14,9): error TS2314: Generic type 'G' requires 2 type argument(s). +tests/cases/compiler/generics1.ts(13,9): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/generics1.ts(14,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/generics1.ts(14,9): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. -==== tests/cases/compiler/generics1.ts (3 errors) ==== +==== tests/cases/compiler/generics1.ts (4 errors) ==== interface A { a: string; } interface B extends A { b: string; } interface C extends B { c: string; } @@ -22,8 +23,10 @@ tests/cases/compiler/generics1.ts(14,9): error TS2314: Generic type 'G' re var v5: G; // Error, any does not satisfy constraint B var v6: G; // Error, wrong number of arguments ~~~~~~ -!!! error TS2314: Generic type 'G' requires 2 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. var v7: G; // Error, no type arguments ~ -!!! error TS2314: Generic type 'G' requires 2 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. + ~ +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/generics2.errors.txt b/tests/baselines/reference/generics2.errors.txt index d44bc7baad8df..9cbdd035f8cc3 100644 --- a/tests/baselines/reference/generics2.errors.txt +++ b/tests/baselines/reference/generics2.errors.txt @@ -1,10 +1,11 @@ tests/cases/compiler/generics2.ts(17,14): error TS2344: Type 'A' does not satisfy the constraint 'B'. Property 'b' is missing in type 'A'. -tests/cases/compiler/generics2.ts(20,9): error TS2314: Generic type 'G' requires 2 type argument(s). -tests/cases/compiler/generics2.ts(21,9): error TS2314: Generic type 'G' requires 2 type argument(s). +tests/cases/compiler/generics2.ts(20,9): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/generics2.ts(21,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/generics2.ts(21,9): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. -==== tests/cases/compiler/generics2.ts (3 errors) ==== +==== tests/cases/compiler/generics2.ts (4 errors) ==== interface A { a: string; } interface B extends A { b: string; } interface C extends B { c: string; } @@ -29,8 +30,10 @@ tests/cases/compiler/generics2.ts(21,9): error TS2314: Generic type 'G' re var v5: G; // Error, any does not satisfy constraint B var v6: G; // Error, wrong number of arguments ~~~~~~ -!!! error TS2314: Generic type 'G' requires 2 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. var v7: G; // Error, no type arguments ~ -!!! error TS2314: Generic type 'G' requires 2 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. + ~ +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt b/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt index c1382788bebd6..bce7fd84986f3 100644 --- a/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt +++ b/tests/baselines/reference/genericsWithoutTypeParameters1.errors.txt @@ -1,18 +1,18 @@ -tests/cases/compiler/genericsWithoutTypeParameters1.ts(9,9): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(10,9): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(11,11): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(12,11): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(14,17): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(14,23): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,20): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,29): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(17,13): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(18,14): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(21,8): error TS2314: Generic type 'C' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(22,8): error TS2314: Generic type 'D' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(26,8): error TS2314: Generic type 'I' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(27,8): error TS2314: Generic type 'J' requires 1 type argument(s). -tests/cases/compiler/genericsWithoutTypeParameters1.ts(31,22): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/genericsWithoutTypeParameters1.ts(9,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(10,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(11,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(12,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(14,17): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(14,23): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,20): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(15,29): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(17,13): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(18,14): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(21,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(22,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(26,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(27,8): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/genericsWithoutTypeParameters1.ts(31,22): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/genericsWithoutTypeParameters1.ts (15 errors) ==== @@ -26,56 +26,56 @@ tests/cases/compiler/genericsWithoutTypeParameters1.ts(31,22): error TS2314: Gen var c1: C; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var i1: I; ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var c2: C; ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var i2: I; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. function foo(x: C, y: I) { } ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. function foo2(x: C, y: I) { } ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var x: { a: C } = { a: new C() }; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var x2: { a: I } = { a: { bar() { return 1 } } }; ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. class D { x: C; ~ -!!! error TS2314: Generic type 'C' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. y: D; ~ -!!! error TS2314: Generic type 'D' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } interface J { x: I; ~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. y: J; ~ -!!! error TS2314: Generic type 'J' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } class A { } function f(x: T): A { ~ -!!! error TS2314: Generic type 'A' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. return null; } \ No newline at end of file diff --git a/tests/baselines/reference/missingTypeArguments1.errors.txt b/tests/baselines/reference/missingTypeArguments1.errors.txt index c0e0f3e18bbb4..9cd9b63facdf7 100644 --- a/tests/baselines/reference/missingTypeArguments1.errors.txt +++ b/tests/baselines/reference/missingTypeArguments1.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/missingTypeArguments1.ts(4,15): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments1.ts(9,26): error TS2314: Generic type 'X2' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments1.ts(14,9): error TS2314: Generic type 'X3' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments1.ts(19,11): error TS2314: Generic type 'X4' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments1.ts(24,9): error TS2314: Generic type 'X5' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments1.ts(29,15): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments1.ts(34,26): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments1.ts(39,9): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments1.ts(44,11): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments1.ts(49,9): error TS2314: Generic type 'Y' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments1.ts(4,15): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments1.ts(9,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments1.ts(14,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments1.ts(19,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments1.ts(24,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments1.ts(29,15): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments1.ts(34,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments1.ts(39,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments1.ts(44,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments1.ts(49,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/missingTypeArguments1.ts (10 errors) ==== @@ -16,72 +16,72 @@ tests/cases/compiler/missingTypeArguments1.ts(49,9): error TS2314: Generic type class X { p1: () => X; ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a: X; class X2 { - p2: { [idx: number]: X2 } + p2: { [idx: number]: X2 } ~~ -!!! error TS2314: Generic type 'X2' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a2: X2; class X3 { p3: X3[] ~~ -!!! error TS2314: Generic type 'X3' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a3: X3; class X4 { p4: I ~~ -!!! error TS2314: Generic type 'X4' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a4: X4; class X5 { p5: X5 ~~ -!!! error TS2314: Generic type 'X5' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a5: X5; class X6 { p6: () => Y; ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a6: X6; class X7 { - p7: { [idx: number]: Y } + p7: { [idx: number]: Y } ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a7: X7; class X8 { p8: Y[] ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a8: X8; class X9 { p9: I ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a9: X9; class X10 { pa: Y ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var a10: X10; - + \ No newline at end of file diff --git a/tests/baselines/reference/missingTypeArguments1.js b/tests/baselines/reference/missingTypeArguments1.js index 3e22e6ce16b4d..d69b0b3531159 100644 --- a/tests/baselines/reference/missingTypeArguments1.js +++ b/tests/baselines/reference/missingTypeArguments1.js @@ -7,7 +7,7 @@ class X { var a: X; class X2 { - p2: { [idx: number]: X2 } + p2: { [idx: number]: X2 } } var a2: X2; @@ -32,7 +32,7 @@ class X6 { var a6: X6; class X7 { - p7: { [idx: number]: Y } + p7: { [idx: number]: Y } } var a7: X7; @@ -51,7 +51,7 @@ class X10 { } var a10: X10; - + //// [missingTypeArguments1.js] diff --git a/tests/baselines/reference/missingTypeArguments2.errors.txt b/tests/baselines/reference/missingTypeArguments2.errors.txt index 0b51f40c1ed8f..ac24a7a8b83b6 100644 --- a/tests/baselines/reference/missingTypeArguments2.errors.txt +++ b/tests/baselines/reference/missingTypeArguments2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/missingTypeArguments2.ts(3,14): error TS2314: Generic type 'A' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments2.ts(4,5): error TS2314: Generic type 'A' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments2.ts(5,10): error TS2314: Generic type 'A' requires 1 type argument(s). -tests/cases/compiler/missingTypeArguments2.ts(6,5): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/missingTypeArguments2.ts(3,14): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments2.ts(4,5): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments2.ts(5,10): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/missingTypeArguments2.ts(6,5): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/missingTypeArguments2.ts (4 errors) ==== @@ -9,13 +9,13 @@ tests/cases/compiler/missingTypeArguments2.ts(6,5): error TS2314: Generic type ' var x: () => A; ~ -!!! error TS2314: Generic type 'A' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. (a: A) => { }; ~ -!!! error TS2314: Generic type 'A' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. var y: A; ~ -!!! error TS2314: Generic type 'A' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. (): A => null; ~ -!!! error TS2314: Generic type 'A' requires 1 type argument(s). \ No newline at end of file +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt b/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt index 4800ccf3c179d..daff469877ffd 100644 --- a/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt +++ b/tests/baselines/reference/noTypeArgumentOnReturnType1.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/noTypeArgumentOnReturnType1.ts(3,9): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/noTypeArgumentOnReturnType1.ts(3,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/noTypeArgumentOnReturnType1.ts (1 errors) ==== class A{ - + foo(): A{ ~ -!!! error TS2314: Generic type 'A' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. return null; } } \ No newline at end of file diff --git a/tests/baselines/reference/noTypeArgumentOnReturnType1.js b/tests/baselines/reference/noTypeArgumentOnReturnType1.js index 7ede1e57c3e56..54526241298df 100644 --- a/tests/baselines/reference/noTypeArgumentOnReturnType1.js +++ b/tests/baselines/reference/noTypeArgumentOnReturnType1.js @@ -1,6 +1,6 @@ //// [noTypeArgumentOnReturnType1.ts] class A{ - + foo(): A{ return null; } diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation3.errors.txt b/tests/baselines/reference/recursiveBaseConstructorCreation3.errors.txt index bd39249289984..f14a7838860a5 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation3.errors.txt +++ b/tests/baselines/reference/recursiveBaseConstructorCreation3.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/recursiveBaseConstructorCreation3.ts(6,27): error TS2314: Generic type 'abc' requires 1 type argument(s). +tests/cases/compiler/recursiveBaseConstructorCreation3.ts(6,27): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. tests/cases/compiler/recursiveBaseConstructorCreation3.ts(9,11): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -10,7 +10,7 @@ tests/cases/compiler/recursiveBaseConstructorCreation3.ts(9,11): error TS2351: C } declare class xyz extends abc { ~~~ -!!! error TS2314: Generic type 'abc' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } var bar = new xyz(); // Error: Invalid 'new' expression. diff --git a/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.errors.txt b/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.errors.txt index d9b5149c2dfb1..bdad530c53a72 100644 --- a/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.errors.txt +++ b/tests/baselines/reference/recursiveTypeParameterConstraintReferenceLacksTypeArgs.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/recursiveTypeParameterConstraintReferenceLacksTypeArgs.ts(1,19): error TS2314: Generic type 'A' requires 1 type argument(s). +tests/cases/compiler/recursiveTypeParameterConstraintReferenceLacksTypeArgs.ts(1,19): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/recursiveTypeParameterConstraintReferenceLacksTypeArgs.ts (1 errors) ==== class A { } ~ -!!! error TS2314: Generic type 'A' requires 1 type argument(s). \ No newline at end of file +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/baselines/reference/returnTypeTypeArguments.errors.txt b/tests/baselines/reference/returnTypeTypeArguments.errors.txt index 080da44e7f706..1a7283ba1f4dc 100644 --- a/tests/baselines/reference/returnTypeTypeArguments.errors.txt +++ b/tests/baselines/reference/returnTypeTypeArguments.errors.txt @@ -1,43 +1,53 @@ -tests/cases/compiler/returnTypeTypeArguments.ts(14,16): error TS2314: Generic type 'One' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(15,16): error TS2314: Generic type 'Two' requires 2 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(16,16): error TS2314: Generic type 'Three' requires 3 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(18,16): error TS2314: Generic type 'Two' requires 2 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(19,16): error TS2314: Generic type 'Three' requires 3 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(20,16): error TS2314: Generic type 'Three' requires 3 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(23,11): error TS2314: Generic type 'One' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(24,11): error TS2314: Generic type 'Two' requires 2 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(25,11): error TS2314: Generic type 'Three' requires 3 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(27,11): error TS2314: Generic type 'Two' requires 2 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(28,11): error TS2314: Generic type 'Three' requires 3 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(29,11): error TS2314: Generic type 'Three' requires 3 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(33,11): error TS2314: Generic type 'Two' requires 2 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(34,11): error TS2314: Generic type 'Three' requires 3 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(36,11): error TS2314: Generic type 'Two' requires 2 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(37,11): error TS2314: Generic type 'Three' requires 3 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(38,11): error TS2314: Generic type 'Three' requires 3 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(52,15): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(53,26): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(54,9): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(55,11): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(56,9): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(57,15): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(58,26): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(59,9): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(60,11): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(61,9): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(65,15): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(66,26): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(67,9): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(68,11): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(69,9): error TS2314: Generic type 'X' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(70,15): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(71,26): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(72,9): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(73,11): error TS2314: Generic type 'Y' requires 1 type argument(s). -tests/cases/compiler/returnTypeTypeArguments.ts(74,9): error TS2314: Generic type 'Y' requires 1 type argument(s). +tests/cases/compiler/returnTypeTypeArguments.ts(14,16): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(15,16): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(15,16): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(16,16): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(16,16): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(16,16): error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(18,16): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(19,16): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(19,16): error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(20,16): error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(23,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(24,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(24,11): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(25,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(25,11): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(25,11): error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(27,11): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(28,11): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(28,11): error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(29,11): error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(33,11): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(34,11): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(34,11): error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(36,11): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(37,11): error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(37,11): error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(38,11): error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(52,15): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(53,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(54,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(55,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(56,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(57,15): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(58,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(59,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(60,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(61,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(65,15): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(66,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(67,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(68,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(69,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(70,15): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(71,26): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(72,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(73,11): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/returnTypeTypeArguments.ts(74,9): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. -==== tests/cases/compiler/returnTypeTypeArguments.ts (37 errors) ==== +==== tests/cases/compiler/returnTypeTypeArguments.ts (47 errors) ==== class One{ value: T; } @@ -53,63 +63,83 @@ tests/cases/compiler/returnTypeTypeArguments.ts(74,9): error TS2314: Generic typ function A1(): One { return null; } ~~~ -!!! error TS2314: Generic type 'One' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. function A2(): Two { return null; } ~~~ -!!! error TS2314: Generic type 'Two' requires 2 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. + ~~~ +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. function A3(): Three { return null; } ~~~~~ -!!! error TS2314: Generic type 'Three' requires 3 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. + ~~~~~ +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. + ~~~~~ +!!! error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. function B1(): Two { return null; } ~~~~~~~~~~~ -!!! error TS2314: Generic type 'Two' requires 2 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. function B2(): Three { return null; } ~~~~~~~~~~~~~ -!!! error TS2314: Generic type 'Three' requires 3 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~~~~ +!!! error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. function B3(): Three { return null; } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2314: Generic type 'Three' requires 3 type argument(s). +!!! error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. class C { A1(): One { return null; } ~~~ -!!! error TS2314: Generic type 'One' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. A2(): Two { return null; } ~~~ -!!! error TS2314: Generic type 'Two' requires 2 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. + ~~~ +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. A3(): Three { return null; } ~~~~~ -!!! error TS2314: Generic type 'Three' requires 3 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. + ~~~~~ +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. + ~~~~~ +!!! error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. B1(): Two { return null; } ~~~~~~~~~~~ -!!! error TS2314: Generic type 'Two' requires 2 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. B2(): Three { return null; } ~~~~~~~~~~~~~ -!!! error TS2314: Generic type 'Three' requires 3 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. + ~~~~~~~~~~~~~ +!!! error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. B3(): Three { return null; } ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2314: Generic type 'Three' requires 3 type argument(s). +!!! error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. } class D { A2(): Two { return null; } ~~~~~~ -!!! error TS2314: Generic type 'Two' requires 2 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. A3(): Three { return null; } ~~~~~~~~ -!!! error TS2314: Generic type 'Three' requires 3 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. + ~~~~~~~~ +!!! error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. B1(): Two { return null; } ~~~~~~ -!!! error TS2314: Generic type 'Two' requires 2 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. B2(): Three { return null; } ~~~~~~~~ -!!! error TS2314: Generic type 'Three' requires 3 type argument(s). +!!! error TS2707: Type parameter 'U' implicitly has type 'any' because it was not supplied. + ~~~~~~~~ +!!! error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. B3(): Three { return null; } ~~~~~~~~~~~~~~~~ -!!! error TS2314: Generic type 'Three' requires 3 type argument(s). +!!! error TS2707: Type parameter 'V' implicitly has type 'any' because it was not supplied. } interface I { @@ -125,66 +155,66 @@ tests/cases/compiler/returnTypeTypeArguments.ts(74,9): error TS2314: Generic typ { p1: () => X; ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p2: { [idx: number]: X } ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p3: X[] ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p4: I ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p5: X ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p6: () => Y; ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p7: { [idx: number]: Y } ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p8: Y[] ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p9: I ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. pa: Y ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. } declare var a: { p1: () => X; ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p2: { [idx: number]: X } ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p3: X[] ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p4: I ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p5: X ~ -!!! error TS2314: Generic type 'X' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p6: () => Y; ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p7: { [idx: number]: Y } ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p8: Y[] ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. p9: I ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. pa: Y ~ -!!! error TS2314: Generic type 'Y' requires 1 type argument(s). +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. }; \ No newline at end of file diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.errors.txt b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.errors.txt index f491cac9f0c70..2686f2e59c0ca 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.errors.txt +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.errors.txt @@ -1,7 +1,9 @@ -tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts(8,17): error TS2314: Generic type 'A' requires 2 type argument(s). +tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts(8,17): error TS2707: Type parameter 'T2' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts(9,21): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts(9,27): error TS7006: Parameter 'value' implicitly has an 'any' type. -==== tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts (1 errors) ==== +==== tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts (3 errors) ==== class A { constructor(private map: (value: T1) => T2) { @@ -11,6 +13,10 @@ tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrec class B extends A { ~~~~~~~~~ -!!! error TS2314: Generic type 'A' requires 2 type argument(s). +!!! error TS2707: Type parameter 'T2' implicitly has type 'any' because it was not supplied. constructor() { super(value => String(value)); } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~ +!!! error TS7006: Parameter 'value' implicitly has an 'any' type. } \ No newline at end of file diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.errors.txt b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.errors.txt index 32047f3b41719..efe8f96edd569 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.errors.txt +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.errors.txt @@ -1,7 +1,10 @@ -tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts(8,17): error TS2314: Generic type 'A' requires 2 type argument(s). +tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts(8,17): error TS2707: Type parameter 'T1' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts(8,17): error TS2707: Type parameter 'T2' implicitly has type 'any' because it was not supplied. +tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts(9,21): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts(9,27): error TS7006: Parameter 'value' implicitly has an 'any' type. -==== tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts (1 errors) ==== +==== tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts (4 errors) ==== class A { constructor(private map: (value: T1) => T2) { @@ -11,6 +14,12 @@ tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeAr class B extends A { ~ -!!! error TS2314: Generic type 'A' requires 2 type argument(s). +!!! error TS2707: Type parameter 'T1' implicitly has type 'any' because it was not supplied. + ~ +!!! error TS2707: Type parameter 'T2' implicitly has type 'any' because it was not supplied. constructor() { super(value => String(value)); } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + ~~~~~ +!!! error TS7006: Parameter 'value' implicitly has an 'any' type. } \ No newline at end of file diff --git a/tests/baselines/reference/tooManyTypeParameters1.errors.txt b/tests/baselines/reference/tooManyTypeParameters1.errors.txt index 2355ef55e5699..31c078071db84 100644 --- a/tests/baselines/reference/tooManyTypeParameters1.errors.txt +++ b/tests/baselines/reference/tooManyTypeParameters1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/tooManyTypeParameters1.ts(2,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/tooManyTypeParameters1.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/tooManyTypeParameters1.ts(8,9): error TS2346: Supplied parameters do not match any signature of call target. -tests/cases/compiler/tooManyTypeParameters1.ts(11,8): error TS2314: Generic type 'I' requires 1 type argument(s). +tests/cases/compiler/tooManyTypeParameters1.ts(11,8): error TS2314: Generic type 'I' requires 1 or fewer type argument(s). ==== tests/cases/compiler/tooManyTypeParameters1.ts (4 errors) ==== @@ -23,4 +23,4 @@ tests/cases/compiler/tooManyTypeParameters1.ts(11,8): error TS2314: Generic type interface I {} var i: I; ~~~~~~~~~~~~~~~~ -!!! error TS2314: Generic type 'I' requires 1 type argument(s). \ No newline at end of file +!!! error TS2314: Generic type 'I' requires 1 or fewer type argument(s). \ No newline at end of file diff --git a/tests/baselines/reference/typeAliasDeclarationEmit.errors.txt b/tests/baselines/reference/typeAliasDeclarationEmit.errors.txt index 2fd71844dc4c4..652df9613f20c 100644 --- a/tests/baselines/reference/typeAliasDeclarationEmit.errors.txt +++ b/tests/baselines/reference/typeAliasDeclarationEmit.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/typeAliasDeclarationEmit.ts(4,37): error TS2314: Generic type 'callback' requires 1 type argument(s). +tests/cases/compiler/typeAliasDeclarationEmit.ts(4,37): error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. ==== tests/cases/compiler/typeAliasDeclarationEmit.ts (1 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/typeAliasDeclarationEmit.ts(4,37): error TS2314: Generic ty export type CallbackArray = () => T; ~~~~~~~~ -!!! error TS2314: Generic type 'callback' requires 1 type argument(s). \ No newline at end of file +!!! error TS2707: Type parameter 'T' implicitly has type 'any' because it was not supplied. \ No newline at end of file diff --git a/tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts b/tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts index 5f44389ba933d..e9fceb3e6ba57 100644 --- a/tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts +++ b/tests/cases/compiler/arrayLiteralAndArrayConstructorEquivalence1.ts @@ -1,12 +1,13 @@ -var myCars=new Array(); +// @noImplicitAny: true +var myCars=new Array(); var myCars3 = new Array({}); var myCars4: Array; // error var myCars5: Array[]; - + myCars = myCars3; myCars = myCars4; myCars = myCars5; - + myCars3 = myCars; myCars3 = myCars4; -myCars3 = myCars5; +myCars3 = myCars5; diff --git a/tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts b/tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts index 60a6a5a770c6e..76c09364cc637 100644 --- a/tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts +++ b/tests/cases/compiler/arrayReferenceWithoutTypeArgs.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true class X { public f(a: Array) { } } \ No newline at end of file diff --git a/tests/cases/compiler/emptyGenericParamList.ts b/tests/cases/compiler/emptyGenericParamList.ts index 4c8b2f9da8125..e89f88c4d6611 100644 --- a/tests/cases/compiler/emptyGenericParamList.ts +++ b/tests/cases/compiler/emptyGenericParamList.ts @@ -1,2 +1,3 @@ +// @noImplicitAny: true class I {} var x: I<>; \ No newline at end of file diff --git a/tests/cases/compiler/externalModuleExportingGenericClass.ts b/tests/cases/compiler/externalModuleExportingGenericClass.ts index b20afb5601374..38cacda12717e 100644 --- a/tests/cases/compiler/externalModuleExportingGenericClass.ts +++ b/tests/cases/compiler/externalModuleExportingGenericClass.ts @@ -1,4 +1,5 @@ // @module: commonjs +// @noImplicitAny: true // @Filename: externalModuleExportingGenericClass_file0.ts class C { diff --git a/tests/cases/compiler/genericArrayAssignmentCompatErrors.ts b/tests/cases/compiler/genericArrayAssignmentCompatErrors.ts index 3e58bafebef36..032d2f77d2f0b 100644 --- a/tests/cases/compiler/genericArrayAssignmentCompatErrors.ts +++ b/tests/cases/compiler/genericArrayAssignmentCompatErrors.ts @@ -1,20 +1,21 @@ -var myCars=new Array(); -var myCars2 = new []; -var myCars3 = new Array({}); -var myCars4: Array; // error -var myCars5: Array[]; - -myCars = myCars2; -myCars = myCars3; -myCars = myCars4; -myCars = myCars5; - -myCars2 = myCars; -myCars2 = myCars3; -myCars2 = myCars4; -myCars2 = myCars5; - -myCars3 = myCars; -myCars3 = myCars2; -myCars3 = myCars4; -myCars3 = myCars5; +// @noImplicitAny: true +var myCars=new Array(); +var myCars2 = new []; +var myCars3 = new Array({}); +var myCars4: Array; // error +var myCars5: Array[]; + +myCars = myCars2; +myCars = myCars3; +myCars = myCars4; +myCars = myCars5; + +myCars2 = myCars; +myCars2 = myCars3; +myCars2 = myCars4; +myCars2 = myCars5; + +myCars3 = myCars; +myCars3 = myCars2; +myCars3 = myCars4; +myCars3 = myCars5; diff --git a/tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts b/tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts index 0963995c84c20..ab4f0151f6717 100644 --- a/tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts +++ b/tests/cases/compiler/genericArrayWithoutTypeAnnotation.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true interface IFoo{ } class Bar { diff --git a/tests/cases/compiler/genericCloduleInModule2.ts b/tests/cases/compiler/genericCloduleInModule2.ts index 28e522217bb39..a376d0cde6f54 100644 --- a/tests/cases/compiler/genericCloduleInModule2.ts +++ b/tests/cases/compiler/genericCloduleInModule2.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true module A { export class B { foo() { } diff --git a/tests/cases/compiler/genericGetter2.ts b/tests/cases/compiler/genericGetter2.ts index f66bfb53de287..0876d3c47ed95 100644 --- a/tests/cases/compiler/genericGetter2.ts +++ b/tests/cases/compiler/genericGetter2.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true class A { } class C { diff --git a/tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts b/tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts index 7b93ac1bc88a1..d514b9280ff45 100644 --- a/tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts +++ b/tests/cases/compiler/genericInterfacesWithoutTypeArguments.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true interface I { } class C { } var i: I; diff --git a/tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts b/tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts index a655d2f5ab0c2..c9d63a514b69c 100644 --- a/tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts +++ b/tests/cases/compiler/genericLambaArgWithoutTypeArguments.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true interface Foo { x: T; } diff --git a/tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts b/tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts index 299e88e67c5ef..52206516640f3 100644 --- a/tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts +++ b/tests/cases/compiler/genericRecursiveImplicitConstructorErrors1.ts @@ -1,4 +1,5 @@ //@module: amd +// @noImplicitAny: true export declare module TypeScript { class PullSymbol { } class PullSignatureSymbol extends PullSymbol { @@ -10,4 +11,4 @@ export declare module TypeScript { class PullTypeParameterSymbol extends PullTypeSymbol { } } - + diff --git a/tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts b/tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts index 3d94ffbdbe631..e06a02923fbeb 100644 --- a/tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts +++ b/tests/cases/compiler/genericRecursiveImplicitConstructorErrors3.ts @@ -1,10 +1,11 @@ +// @noImplicitAny: true module TypeScript { export class MemberName { static create(arg1: any, arg2?: any, arg3?: any): MemberName { } } } - + module TypeScript { export class PullSymbol { public type: PullTypeSymbol = null; @@ -26,4 +27,4 @@ module TypeScript { } } } - + diff --git a/tests/cases/compiler/genericReturnTypeFromGetter1.ts b/tests/cases/compiler/genericReturnTypeFromGetter1.ts index b1c869e6852d4..45a8ada809b5f 100644 --- a/tests/cases/compiler/genericReturnTypeFromGetter1.ts +++ b/tests/cases/compiler/genericReturnTypeFromGetter1.ts @@ -1,4 +1,5 @@ //@module: amd +// @noImplicitAny: true export interface A { new (dbSet: DbSet): T; } diff --git a/tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts b/tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts index cf7890aac125c..14b054d8a7d80 100644 --- a/tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts +++ b/tests/cases/compiler/genericTypeReferencesRequireTypeArgs.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true class C { foo(): T { return null } } diff --git a/tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts b/tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts index cbbf737cb6994..864867f2c0dbd 100644 --- a/tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts +++ b/tests/cases/compiler/genericTypeUsedWithoutTypeArguments1.ts @@ -1,2 +1,3 @@ +// @noImplicitAny: true interface Foo { } class Bar implements Foo { } diff --git a/tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts b/tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts index 6bb599f9541fd..03206883d78fc 100644 --- a/tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts +++ b/tests/cases/compiler/genericTypeUsedWithoutTypeArguments3.ts @@ -1,2 +1,3 @@ +// @noImplicitAny: true interface Foo { } interface Bar extends Foo { } diff --git a/tests/cases/compiler/generics1.ts b/tests/cases/compiler/generics1.ts index c0a527ca72b58..c6994eb34d1e6 100644 --- a/tests/cases/compiler/generics1.ts +++ b/tests/cases/compiler/generics1.ts @@ -1,14 +1,15 @@ -interface A { a: string; } -interface B extends A { b: string; } -interface C extends B { c: string; } -interface G { - x: T; - y: U; -} -var v1: G; // Ok -var v2: G<{ a: string }, C>; // Ok, equivalent to G -var v3: G; // Error, A not valid argument for U -var v4: G, C>; // Ok -var v5: G; // Error, any does not satisfy constraint B -var v6: G; // Error, wrong number of arguments -var v7: G; // Error, no type arguments +// @noImplicitAny: true +interface A { a: string; } +interface B extends A { b: string; } +interface C extends B { c: string; } +interface G { + x: T; + y: U; +} +var v1: G; // Ok +var v2: G<{ a: string }, C>; // Ok, equivalent to G +var v3: G; // Error, A not valid argument for U +var v4: G, C>; // Ok +var v5: G; // Error, any does not satisfy constraint B +var v6: G; // Error, wrong number of arguments +var v7: G; // Error, no type arguments diff --git a/tests/cases/compiler/generics2.ts b/tests/cases/compiler/generics2.ts index 8287cfc714832..cc7c545f34413 100644 --- a/tests/cases/compiler/generics2.ts +++ b/tests/cases/compiler/generics2.ts @@ -1,21 +1,22 @@ -interface A { a: string; } -interface B extends A { b: string; } -interface C extends B { c: string; } -interface G { - x: T; - y: U; -} - - -var v1: { - x: { a: string; } - y: { a: string; b: string; c: string }; -}; // Ok - - -var v2: G<{ a: string }, C>; // Ok, equivalent to G -var v3: G; // Error, A not valid argument for U -var v4: G, C>; // Ok -var v5: G; // Error, any does not satisfy constraint B -var v6: G; // Error, wrong number of arguments -var v7: G; // Error, no type arguments +// @noImplicitAny: true +interface A { a: string; } +interface B extends A { b: string; } +interface C extends B { c: string; } +interface G { + x: T; + y: U; +} + + +var v1: { + x: { a: string; } + y: { a: string; b: string; c: string }; +}; // Ok + + +var v2: G<{ a: string }, C>; // Ok, equivalent to G +var v3: G; // Error, A not valid argument for U +var v4: G, C>; // Ok +var v5: G; // Error, any does not satisfy constraint B +var v6: G; // Error, wrong number of arguments +var v7: G; // Error, no type arguments diff --git a/tests/cases/compiler/genericsWithoutTypeParameters1.ts b/tests/cases/compiler/genericsWithoutTypeParameters1.ts index 16730a5eb5125..e884fa6df1915 100644 --- a/tests/cases/compiler/genericsWithoutTypeParameters1.ts +++ b/tests/cases/compiler/genericsWithoutTypeParameters1.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true class C { foo(): T { return null } } diff --git a/tests/cases/compiler/missingTypeArguments1.ts b/tests/cases/compiler/missingTypeArguments1.ts index 387a1539e060b..71717443f116c 100644 --- a/tests/cases/compiler/missingTypeArguments1.ts +++ b/tests/cases/compiler/missingTypeArguments1.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true interface I { } class Y {} class X { @@ -6,7 +7,7 @@ class X { var a: X; class X2 { - p2: { [idx: number]: X2 } + p2: { [idx: number]: X2 } } var a2: X2; @@ -31,7 +32,7 @@ class X6 { var a6: X6; class X7 { - p7: { [idx: number]: Y } + p7: { [idx: number]: Y } } var a7: X7; @@ -50,4 +51,4 @@ class X10 { } var a10: X10; - + diff --git a/tests/cases/compiler/missingTypeArguments2.ts b/tests/cases/compiler/missingTypeArguments2.ts index 856f9e85acc53..d8dcd5a27084e 100644 --- a/tests/cases/compiler/missingTypeArguments2.ts +++ b/tests/cases/compiler/missingTypeArguments2.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true class A { } var x: () => A; diff --git a/tests/cases/compiler/noTypeArgumentOnReturnType1.ts b/tests/cases/compiler/noTypeArgumentOnReturnType1.ts index cd4a3ae19c4a0..0d31e8f75a812 100644 --- a/tests/cases/compiler/noTypeArgumentOnReturnType1.ts +++ b/tests/cases/compiler/noTypeArgumentOnReturnType1.ts @@ -1,5 +1,6 @@ +// @noImplicitAny: true class A{ - + foo(): A{ return null; } diff --git a/tests/cases/compiler/recursiveBaseConstructorCreation3.ts b/tests/cases/compiler/recursiveBaseConstructorCreation3.ts index e5746ef824aae..f06d27599503a 100644 --- a/tests/cases/compiler/recursiveBaseConstructorCreation3.ts +++ b/tests/cases/compiler/recursiveBaseConstructorCreation3.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true declare class base { } declare class abc extends base { diff --git a/tests/cases/compiler/recursiveTypeParameterConstraintReferenceLacksTypeArgs.ts b/tests/cases/compiler/recursiveTypeParameterConstraintReferenceLacksTypeArgs.ts index b6c717fceccdb..e593442d3ced3 100644 --- a/tests/cases/compiler/recursiveTypeParameterConstraintReferenceLacksTypeArgs.ts +++ b/tests/cases/compiler/recursiveTypeParameterConstraintReferenceLacksTypeArgs.ts @@ -1 +1,2 @@ +// @noImplicitAny: true class A { } \ No newline at end of file diff --git a/tests/cases/compiler/returnTypeTypeArguments.ts b/tests/cases/compiler/returnTypeTypeArguments.ts index 94a3d8b094e44..bfba0af8f15d8 100644 --- a/tests/cases/compiler/returnTypeTypeArguments.ts +++ b/tests/cases/compiler/returnTypeTypeArguments.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true class One{ value: T; } diff --git a/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts b/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts index d633ccb018fc7..7ef27d7cd88cc 100644 --- a/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts +++ b/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true class A { constructor(private map: (value: T1) => T2) { diff --git a/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts b/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts index c09fb37db2d09..7b805236a6496 100644 --- a/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts +++ b/tests/cases/compiler/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.ts @@ -1,3 +1,4 @@ +// @noImplicitAny: true class A { constructor(private map: (value: T1) => T2) { diff --git a/tests/cases/compiler/typeAliasDeclarationEmit.ts b/tests/cases/compiler/typeAliasDeclarationEmit.ts index be7e40453f60d..c58d49de2a03c 100644 --- a/tests/cases/compiler/typeAliasDeclarationEmit.ts +++ b/tests/cases/compiler/typeAliasDeclarationEmit.ts @@ -1,6 +1,7 @@ // @target: ES5 // @module: AMD // @declaration: true +// @noImplicitAny: true export type callback = () => T; diff --git a/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts b/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts index fdd51b3f5c6d6..50899f036156e 100644 --- a/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts +++ b/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.d.ts @@ -1,5 +1,6 @@ +// @noImplicitAny: true // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors declare class C { foo: T; diff --git a/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts b/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts index 86f6df5cdfe3d..215a16e5acac4 100644 --- a/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts +++ b/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument.ts @@ -1,5 +1,6 @@ +// @noImplicitAny: true // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors class C { foo: T; diff --git a/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts b/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts index 7f062766cb3b5..ac74873a7e538 100644 --- a/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts +++ b/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument2.ts @@ -1,5 +1,6 @@ +// @noImplicitAny: true // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors interface I { foo: T; diff --git a/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts b/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts index fdd51b3f5c6d6..50899f036156e 100644 --- a/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts +++ b/tests/cases/conformance/types/specifyingTypes/typeReferences/genericTypeReferenceWithoutTypeArgument3.ts @@ -1,5 +1,6 @@ +// @noImplicitAny: true // it is an error to use a generic type without type arguments -// all of these are errors +// all of these are errors declare class C { foo: T; From 895450106db8a8948b33a52af7911c0529f3dc9a Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 1 Mar 2017 12:30:38 -0800 Subject: [PATCH 3/3] Address remaining fourslash tests --- ...odeFixClassImplementInterfaceTypeParamInstantiation.ts | 6 ++++-- tests/cases/fourslash/genericArityEnforcementAfterEdit.ts | 2 +- tests/cases/fourslash/genericCombinators1.ts | 3 ++- tests/cases/fourslash/genericCombinators2.ts | 8 ++++---- tests/cases/fourslash/noTypeParameterInLHS.ts | 2 +- tests/cases/fourslash/underscoreTypings02.ts | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiation.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiation.ts index 226aee4783390..4857f85ba9922 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiation.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiation.ts @@ -4,6 +4,8 @@ //// x: T; //// } //// -//// class C implements I { } +//// class C implements I {[| |]} -verify.not.codeFixAvailable(); \ No newline at end of file +verify.rangeAfterCodeFix(` + x: any; +`); \ No newline at end of file diff --git a/tests/cases/fourslash/genericArityEnforcementAfterEdit.ts b/tests/cases/fourslash/genericArityEnforcementAfterEdit.ts index 5b107e3779eb3..d16bdfd53ba78 100644 --- a/tests/cases/fourslash/genericArityEnforcementAfterEdit.ts +++ b/tests/cases/fourslash/genericArityEnforcementAfterEdit.ts @@ -1,5 +1,5 @@ /// - +// @noImplicitAny: true //// interface G { } //// /**/ //// var v4: G, any>; diff --git a/tests/cases/fourslash/genericCombinators1.ts b/tests/cases/fourslash/genericCombinators1.ts index 53c40aa0013f6..75dc7c96713ce 100644 --- a/tests/cases/fourslash/genericCombinators1.ts +++ b/tests/cases/fourslash/genericCombinators1.ts @@ -1,4 +1,5 @@ /// +// @noImplicitAny: true ////interface Collection { //// length: number; //// add(x: T): void; @@ -58,7 +59,7 @@ verify.quickInfos({ 5: "(parameter) x: number", 6: "var c3: Collection>", 7: "(parameter) x: A", - 8: "(parameter) x: any", // Specialized to any because no type argument was specified + 8: "(parameter) x: B", 9: "var r1a: Collection", 10: "var r1b: Collection", 11: "var r2a: Collection", diff --git a/tests/cases/fourslash/genericCombinators2.ts b/tests/cases/fourslash/genericCombinators2.ts index a5cea18678915..7d21000ccdd8f 100644 --- a/tests/cases/fourslash/genericCombinators2.ts +++ b/tests/cases/fourslash/genericCombinators2.ts @@ -1,5 +1,5 @@ /// - +// @noImplicitAny: true ////interface Collection { //// length: number; //// add(x: T, y: U): void ; @@ -43,7 +43,7 @@ ////} ////var /*15*/r4a = _.map(c5, (/*4a*/x, /*4b*/y) => { return y.foo() }); ////} -////var /*17*/r5a = _.map(c2, /*17error1*/(/*5a*/x, /*5b*/y) => { return x.toFixed() }/*17error2*/); +////var /*17*/r5a = _.map(c2, /*17error1*/(/*5a*/x, /*5b*/y) => { return x.toFixed() }/*17error2*/); ////var rf1b = (x: number, y: string) => { return new Date() }; ////var /*18*/r5b = _.map(c2, rf1b); //// @@ -54,7 +54,7 @@ ////var /*21*/r7a = _.map(c4, /*21error1*/(/*7a*/x,/*7b*/y) => { return y.foo() }/*21error2*/); ////var /*22*/r7b = _.map(c4, /*22error1*/rf3/*22error2*/); //// -////var /*23*/r8a = _.map(c5, (/*8a*/x,/*8b*/y) => { return y.foo() }); +////var /*23*/r8a = _.map(c5, (/*8a*/x,/*8b*/y) => { return y.foo() }); verify.quickInfos({ "2a": "(parameter) x: Collection", @@ -70,7 +70,7 @@ verify.quickInfos({ "7a": "(parameter) x: number", "7b": "(parameter) y: A", "8a": "(parameter) x: number", - "8b": "(parameter) y: any", // Specialized to any because no type argument was specified + "8b": "(parameter) y: B", 9: "var r1a: Collection", 10: "var r1b: Collection", 11: "var r2a: Collection, number>", diff --git a/tests/cases/fourslash/noTypeParameterInLHS.ts b/tests/cases/fourslash/noTypeParameterInLHS.ts index 091226ff1cf00..a91a551daf48e 100644 --- a/tests/cases/fourslash/noTypeParameterInLHS.ts +++ b/tests/cases/fourslash/noTypeParameterInLHS.ts @@ -7,5 +7,5 @@ verify.quickInfos({ 1: "var i: I", - 2: "var c: C" + 2: "var c: C>" }); diff --git a/tests/cases/fourslash/underscoreTypings02.ts b/tests/cases/fourslash/underscoreTypings02.ts index be7d20427e229..f1a44925a87df 100644 --- a/tests/cases/fourslash/underscoreTypings02.ts +++ b/tests/cases/fourslash/underscoreTypings02.ts @@ -20,4 +20,4 @@ //// } goTo.position(0); -verify.numberOfErrorsInCurrentFile(2); +verify.numberOfErrorsInCurrentFile(1);