diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4f4c7b5baf6d1..43cfcb5e1221c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4141,17 +4141,40 @@ namespace ts { : undefined; } - function getConstraintOfTypeParameter(type: TypeParameter): Type { - if (!type.constraint) { - if (type.target) { - const targetConstraint = getConstraintOfTypeParameter(type.target); - type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; + function getConstraintDeclaration(type: TypeParameter) { + return (getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint; + } + + function hasConstraintReferenceTo(type: Type, target: TypeParameter): boolean { + let checked: Type[]; + while (type && type.flags & TypeFlags.TypeParameter && !contains(checked, type)) { + if (type === target) { + return true; + } + (checked || (checked = [])).push(type); + const constraintDeclaration = getConstraintDeclaration(type); + type = constraintDeclaration && getTypeFromTypeNode(constraintDeclaration); + } + return false; + } + + function getConstraintOfTypeParameter(typeParameter: TypeParameter): Type { + if (!typeParameter.constraint) { + if (typeParameter.target) { + const targetConstraint = getConstraintOfTypeParameter(typeParameter.target); + typeParameter.constraint = targetConstraint ? instantiateType(targetConstraint, typeParameter.mapper) : noConstraintType; } else { - type.constraint = getTypeFromTypeNode((getDeclarationOfKind(type.symbol, SyntaxKind.TypeParameter)).constraint); + const constraintDeclaration = getConstraintDeclaration(typeParameter); + let constraint = getTypeFromTypeNode(constraintDeclaration); + if (hasConstraintReferenceTo(constraint, typeParameter)) { + error(constraintDeclaration, Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); + constraint = unknownType; + } + typeParameter.constraint = constraint; } } - return type.constraint === noConstraintType ? undefined : type.constraint; + return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter: TypeParameter): Symbol { @@ -4203,55 +4226,6 @@ namespace ts { return type; } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode: TypeReferenceNode | ExpressionWithTypeArguments, typeParameterSymbol: Symbol): boolean { - const links = getNodeLinks(typeReferenceNode); - if (links.isIllegalTypeReferenceInConstraint !== undefined) { - return links.isIllegalTypeReferenceInConstraint; - } - - // bubble up to the declaration - let currentNode: Node = typeReferenceNode; - // forEach === exists - while (!forEach(typeParameterSymbol.declarations, d => d.parent === currentNode.parent)) { - currentNode = currentNode.parent; - } - // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal - links.isIllegalTypeReferenceInConstraint = currentNode.kind === SyntaxKind.TypeParameter; - return links.isIllegalTypeReferenceInConstraint; - } - - function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter: TypeParameterDeclaration): void { - let typeParameterSymbol: Symbol; - function check(n: Node): void { - if (n.kind === SyntaxKind.TypeReference && (n).typeName.kind === SyntaxKind.Identifier) { - const links = getNodeLinks(n); - if (links.isIllegalTypeReferenceInConstraint === undefined) { - const symbol = resolveName(typeParameter, ((n).typeName).text, SymbolFlags.Type, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined); - if (symbol && (symbol.flags & SymbolFlags.TypeParameter)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - - // symbol.declaration.parent === typeParameter.parent - // -> typeParameter and symbol.declaration originate from the same type parameter list - // -> illegal for all declarations in symbol - // forEach === exists - links.isIllegalTypeReferenceInConstraint = forEach(symbol.declarations, d => d.parent === typeParameter.parent); - } - } - if (links.isIllegalTypeReferenceInConstraint) { - error(typeParameter, Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - forEachChild(n, check); - } - - if (typeParameter.constraint) { - typeParameterSymbol = getSymbolOfNode(typeParameter); - check(typeParameter.constraint); - } - } - // Get type from reference to class or interface function getTypeFromClassOrInterfaceReference(node: TypeReferenceNode | ExpressionWithTypeArguments, symbol: Symbol): Type { const type = getDeclaredTypeOfSymbol(symbol); @@ -4298,13 +4272,6 @@ namespace ts { // Get type from reference to named type that cannot be generic (enum or type parameter) function getTypeFromNonGenericTypeReference(node: TypeReferenceNode | ExpressionWithTypeArguments, symbol: Symbol): Type { - if (symbol.flags & SymbolFlags.TypeParameter && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - // Implementation: such type references are resolved to 'unknown' type that usually denotes error - return unknownType; - } if (node.typeArguments) { error(node, Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); return unknownType; @@ -4751,19 +4718,22 @@ namespace ts { }; } - function createInferenceMapper(context: InferenceContext): TypeMapper { - const mapper: TypeMapper = t => { - for (let i = 0; i < context.typeParameters.length; i++) { - if (t === context.typeParameters[i]) { - context.inferences[i].isFixed = true; - return getInferredType(context, i); + function getInferenceMapper(context: InferenceContext): TypeMapper { + if (!context.mapper) { + const mapper: TypeMapper = t => { + const typeParameters = context.typeParameters; + for (let i = 0; i < typeParameters.length; i++) { + if (t === typeParameters[i]) { + context.inferences[i].isFixed = true; + return getInferredType(context, i); + } } - } - return t; - }; - - mapper.context = context; - return mapper; + return t; + }; + mapper.context = context; + context.mapper = mapper; + } + return context.mapper; } function identityMapper(type: Type): Type { @@ -4774,16 +4744,10 @@ namespace ts { return t => instantiateType(mapper1(t), mapper2); } - function instantiateTypeParameter(typeParameter: TypeParameter, mapper: TypeMapper): TypeParameter { + function cloneTypeParameter(typeParameter: TypeParameter): TypeParameter { const result = createType(TypeFlags.TypeParameter); result.symbol = typeParameter.symbol; - if (typeParameter.constraint) { - result.constraint = instantiateType(typeParameter.constraint, mapper); - } - else { - result.target = typeParameter; - result.mapper = mapper; - } + result.target = typeParameter; return result; } @@ -4791,8 +4755,14 @@ namespace ts { let freshTypeParameters: TypeParameter[]; let freshTypePredicate: TypePredicate; if (signature.typeParameters && !eraseTypeParameters) { - freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); + // First create a fresh set of type parameters, then include a mapping from the old to the + // new type parameters in the mapper function. Finally store this mapper in the new type + // parameters such that we can use it when instantiating constraints. + freshTypeParameters = map(signature.typeParameters, cloneTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); + for (const tp of freshTypeParameters) { + tp.mapper = mapper; + } } if (signature.typePredicate) { freshTypePredicate = { @@ -5263,8 +5233,9 @@ namespace ts { if (sources.length !== targets.length && relation === identityRelation) { return Ternary.False; } + const length = sources.length <= targets.length ? sources.length : targets.length; let result = Ternary.True; - for (let i = 0; i < targets.length; i++) { + for (let i = 0; i < length; i++) { const related = isRelatedTo(sources[i], targets[i], reportErrors); if (!related) { return Ternary.False; @@ -5279,11 +5250,11 @@ namespace ts { // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(apparentSource: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary { + function objectTypeRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary { if (overflow) { return Ternary.False; } - const id = relation !== identityRelation || apparentSource.id < target.id ? apparentSource.id + "," + target.id : target.id + "," + apparentSource.id; + const id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; const related = relation[id]; if (related !== undefined) { if (elaborateErrors && related === RelationComparisonResult.Failed) { @@ -5313,28 +5284,28 @@ namespace ts { maybeStack = []; expandingFlags = 0; } - sourceStack[depth] = apparentSource; + sourceStack[depth] = source; targetStack[depth] = target; maybeStack[depth] = {}; maybeStack[depth][id] = RelationComparisonResult.Succeeded; depth++; const saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(apparentSource, sourceStack, depth)) expandingFlags |= 1; + if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) expandingFlags |= 1; if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) expandingFlags |= 2; let result: Ternary; if (expandingFlags === 3) { result = Ternary.Maybe; } else { - result = propertiesRelatedTo(apparentSource, target, reportErrors); + result = propertiesRelatedTo(source, target, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, SignatureKind.Call, reportErrors); + result &= signaturesRelatedTo(source, target, SignatureKind.Call, reportErrors); if (result) { - result &= signaturesRelatedTo(apparentSource, target, SignatureKind.Construct, reportErrors); + result &= signaturesRelatedTo(source, target, SignatureKind.Construct, reportErrors); if (result) { - result &= stringIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= stringIndexTypesRelatedTo(source, originalSource, target, reportErrors); if (result) { - result &= numberIndexTypesRelatedTo(apparentSource, originalSource, target, reportErrors); + result &= numberIndexTypesRelatedTo(source, originalSource, target, reportErrors); } } } @@ -6375,11 +6346,17 @@ namespace ts { inferredType = emptyObjectType; inferenceSucceeded = true; } + context.inferredTypes[index] = inferredType; // Only do the constraint check if inference succeeded (to prevent cascading errors) if (inferenceSucceeded) { const constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; + if (constraint) { + const instantiatedConstraint = instantiateType(constraint, getInferenceMapper(context)); + if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { + context.inferredTypes[index] = inferredType = instantiatedConstraint; + } + } } else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { // If inference failed, it is necessary to record the index of the failed type parameter (the one we are on). @@ -6387,7 +6364,6 @@ namespace ts { // So if this failure is on preceding type parameter, this type parameter is the new failure index. context.failedTypeParameterIndex = index; } - context.inferredTypes[index] = inferredType; } return inferredType; } @@ -6396,7 +6372,6 @@ namespace ts { for (let i = 0; i < context.inferredTypes.length; i++) { getInferredType(context, i); } - return context.inferredTypes; } @@ -8778,7 +8753,7 @@ namespace ts { function inferTypeArguments(node: CallLikeExpression, signature: Signature, args: Expression[], excludeArgument: boolean[], context: InferenceContext): void { const typeParameters = signature.typeParameters; - const inferenceMapper = createInferenceMapper(context); + const inferenceMapper = getInferenceMapper(context); // Clear out all the inference results from the last time inferTypeArguments was called on this context for (let i = 0; i < typeParameters.length; i++) { @@ -8844,14 +8819,11 @@ namespace ts { getInferredTypes(context); } - function checkTypeArguments(signature: Signature, typeArguments: TypeNode[], typeArgumentResultTypes: Type[], reportErrors: boolean, headMessage?: DiagnosticMessage): boolean { + function checkTypeArguments(signature: Signature, typeArgumentNodes: TypeNode[], typeArgumentTypes: Type[], reportErrors: boolean, headMessage?: DiagnosticMessage): boolean { const typeParameters = signature.typeParameters; let typeArgumentsAreAssignable = true; + let mapper: TypeMapper; for (let i = 0; i < typeParameters.length; i++) { - const typeArgNode = typeArguments[i]; - const typeArgument = getTypeFromTypeNode(typeArgNode); - // Do not push on this array! It has a preallocated length - typeArgumentResultTypes[i] = typeArgument; if (typeArgumentsAreAssignable /* so far */) { const constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { @@ -8861,17 +8833,19 @@ namespace ts { errorInfo = chainDiagnosticMessages(errorInfo, typeArgumentHeadMessage); typeArgumentHeadMessage = headMessage; } - + if (!mapper) { + mapper = createTypeMapper(typeParameters, typeArgumentTypes); + } + const typeArgument = typeArgumentTypes[i]; typeArgumentsAreAssignable = checkTypeAssignableTo( typeArgument, - constraint, - reportErrors ? typeArgNode : undefined, + getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), + reportErrors ? typeArgumentNodes[i] : undefined, typeArgumentHeadMessage, errorInfo); } } } - return typeArgumentsAreAssignable; } @@ -9327,7 +9301,8 @@ namespace ts { } else if (candidateForTypeArgumentError) { if (!isTaggedTemplate && !isDecorator && typeArguments) { - checkTypeArguments(candidateForTypeArgumentError, (node).typeArguments, [], /*reportErrors*/ true, headMessage); + const typeArguments = (node).typeArguments; + checkTypeArguments(candidateForTypeArgumentError, typeArguments, map(typeArguments, getTypeFromTypeNode), /*reportErrors*/ true, headMessage); } else { Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); @@ -9394,7 +9369,7 @@ namespace ts { if (candidate.typeParameters) { let typeArgumentTypes: Type[]; if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); + typeArgumentTypes = map(typeArguments, getTypeFromTypeNode); typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false); } else { @@ -10926,11 +10901,10 @@ namespace ts { } checkSourceElement(node.constraint); + getConstraintOfTypeParameter(getDeclaredTypeOfTypeParameter(getSymbolOfNode(node))); if (produceDiagnostics) { - checkTypeParameterHasIllegalReferencesInConstraint(node); checkTypeNameIsReserved(node.name, Diagnostics.Type_parameter_name_cannot_be_0); } - // TODO: Check multiple declarations are identical } function checkParameter(node: ParameterDeclaration) { @@ -11341,13 +11315,23 @@ namespace ts { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters: TypeParameter[], typeArguments: TypeNode[]): boolean { + function checkTypeArgumentConstraints(typeParameters: TypeParameter[], typeArgumentNodes: TypeNode[]): boolean { + let typeArguments: Type[]; + let mapper: TypeMapper; let result = true; for (let i = 0; i < typeParameters.length; i++) { const constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { + if (!typeArguments) { + typeArguments = map(typeArgumentNodes, getTypeFromTypeNode); + mapper = createTypeMapper(typeParameters, typeArguments); + } const typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(getTypeFromTypeNode(typeArgument), constraint, typeArgument, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo( + typeArgument, + getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), + typeArgumentNodes[i], + Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 6e09a398ea62b..3348b51dff7f7 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -1309,6 +1309,9 @@ namespace ts { } function emitSignatureDeclaration(node: SignatureDeclaration) { + const prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node; + // Construct signature or constructor type write new Signature if (node.kind === SyntaxKind.ConstructSignature || node.kind === SyntaxKind.ConstructorType) { write("new "); @@ -1321,9 +1324,6 @@ namespace ts { write("("); } - const prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - // Parameters emitCommaList(node.parameters, emitParameterDeclaration); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 86f0767c96122..75f1c2b421b19 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -864,7 +864,7 @@ "category": "Error", "code": 2312 }, - "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { + "Type parameter '{0}' has a circular constraint.": { "category": "Error", "code": 2313 }, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 9411437c9815f..84aa29e93b5a2 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2045,7 +2045,6 @@ namespace ts { resolvedSymbol?: Symbol; // Cached name resolution result flags?: NodeCheckFlags; // Set of flags specific to Node enumMemberValue?: number; // Constant value of enum member - isIllegalTypeReferenceInConstraint?: boolean; // Is type reference in constraint refers to the type parameter from the same list isVisible?: boolean; // Is this node visible generatedName?: string; // Generated name for module, enum, or import declaration generatedNames?: Map; // Generated names table for source file @@ -2286,6 +2285,7 @@ namespace ts { inferUnionTypes: boolean; // Infer union types for disjoint candidates (otherwise undefinedType) inferences: TypeInferences[]; // Inferences made for each type parameter inferredTypes: Type[]; // Inferred type for each type parameter + mapper?: TypeMapper; // Type mapper for this inference context failedTypeParameterIndex?: number; // Index of type parameter for which inference failed // It is optional because in contextual signature instantiation, nothing fails } diff --git a/tests/baselines/reference/anyAssignableToEveryType2.errors.txt b/tests/baselines/reference/anyAssignableToEveryType2.errors.txt deleted file mode 100644 index e5f9a07476e3a..0000000000000 --- a/tests/baselines/reference/anyAssignableToEveryType2.errors.txt +++ /dev/null @@ -1,136 +0,0 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType2.ts(114,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType2.ts (1 errors) ==== - // any is not a subtype of any other types, but is assignable, all the below should work - - interface I { - [x: string]: any; - foo: any; // ok, any identical to itself - } - - - interface I2 { - [x: string]: number; - foo: any; - } - - - interface I3 { - [x: string]: string; - foo: any; - } - - - interface I4 { - [x: string]: boolean; - foo: any; - } - - - interface I5 { - [x: string]: Date; - foo: any; - } - - - interface I6 { - [x: string]: RegExp; - foo: any; - } - - - interface I7 { - [x: string]: { bar: number }; - foo: any; - } - - - interface I8 { - [x: string]: number[]; - foo: any; - } - - - interface I9 { - [x: string]: I8; - foo: any; - } - - class A { foo: number; } - interface I10 { - [x: string]: A; - foo: any; - } - - class A2 { foo: T; } - interface I11 { - [x: string]: A2; - foo: any; - } - - - interface I12 { - [x: string]: (x) => number; - foo: any; - } - - - interface I13 { - [x: string]: (x: T) => T; - foo: any; - } - - - enum E { A } - interface I14 { - [x: string]: E; - foo: any; - } - - - function f() { } - module f { - export var bar = 1; - } - interface I15 { - [x: string]: typeof f; - foo: any; - } - - - class c { baz: string } - module c { - export var bar = 1; - } - interface I16 { - [x: string]: typeof c; - foo: any; - } - - - interface I17 { - [x: string]: T; - foo: any; - } - - - interface I18 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - [x: string]: U; - foo: any; - } - - - interface I19 { - [x: string]: Object; - foo: any; - } - - - interface I20 { - [x: string]: {}; - foo: any; - } - \ No newline at end of file diff --git a/tests/baselines/reference/anyAssignableToEveryType2.symbols b/tests/baselines/reference/anyAssignableToEveryType2.symbols new file mode 100644 index 0000000000000..9984a3f2fb8ba --- /dev/null +++ b/tests/baselines/reference/anyAssignableToEveryType2.symbols @@ -0,0 +1,274 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType2.ts === +// any is not a subtype of any other types, but is assignable, all the below should work + +interface I { +>I : Symbol(I, Decl(anyAssignableToEveryType2.ts, 0, 0)) + + [x: string]: any; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 3, 5)) + + foo: any; // ok, any identical to itself +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 3, 21)) +} + + +interface I2 { +>I2 : Symbol(I2, Decl(anyAssignableToEveryType2.ts, 5, 1)) + + [x: string]: number; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 9, 5)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 9, 24)) +} + + +interface I3 { +>I3 : Symbol(I3, Decl(anyAssignableToEveryType2.ts, 11, 1)) + + [x: string]: string; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 15, 5)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 15, 24)) +} + + +interface I4 { +>I4 : Symbol(I4, Decl(anyAssignableToEveryType2.ts, 17, 1)) + + [x: string]: boolean; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 21, 5)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 21, 25)) +} + + +interface I5 { +>I5 : Symbol(I5, Decl(anyAssignableToEveryType2.ts, 23, 1)) + + [x: string]: Date; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 27, 5)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 27, 22)) +} + + +interface I6 { +>I6 : Symbol(I6, Decl(anyAssignableToEveryType2.ts, 29, 1)) + + [x: string]: RegExp; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 33, 5)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 33, 24)) +} + + +interface I7 { +>I7 : Symbol(I7, Decl(anyAssignableToEveryType2.ts, 35, 1)) + + [x: string]: { bar: number }; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 39, 5)) +>bar : Symbol(bar, Decl(anyAssignableToEveryType2.ts, 39, 18)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 39, 33)) +} + + +interface I8 { +>I8 : Symbol(I8, Decl(anyAssignableToEveryType2.ts, 41, 1)) + + [x: string]: number[]; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 45, 5)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 45, 26)) +} + + +interface I9 { +>I9 : Symbol(I9, Decl(anyAssignableToEveryType2.ts, 47, 1)) + + [x: string]: I8; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 51, 5)) +>I8 : Symbol(I8, Decl(anyAssignableToEveryType2.ts, 41, 1)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 51, 20)) +} + +class A { foo: number; } +>A : Symbol(A, Decl(anyAssignableToEveryType2.ts, 53, 1)) +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 55, 9)) + +interface I10 { +>I10 : Symbol(I10, Decl(anyAssignableToEveryType2.ts, 55, 24)) + + [x: string]: A; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 57, 5)) +>A : Symbol(A, Decl(anyAssignableToEveryType2.ts, 53, 1)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 57, 19)) +} + +class A2 { foo: T; } +>A2 : Symbol(A2, Decl(anyAssignableToEveryType2.ts, 59, 1)) +>T : Symbol(T, Decl(anyAssignableToEveryType2.ts, 61, 9)) +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 61, 13)) +>T : Symbol(T, Decl(anyAssignableToEveryType2.ts, 61, 9)) + +interface I11 { +>I11 : Symbol(I11, Decl(anyAssignableToEveryType2.ts, 61, 23)) + + [x: string]: A2; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 63, 5)) +>A2 : Symbol(A2, Decl(anyAssignableToEveryType2.ts, 59, 1)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 63, 28)) +} + + +interface I12 { +>I12 : Symbol(I12, Decl(anyAssignableToEveryType2.ts, 65, 1)) + + [x: string]: (x) => number; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 69, 5)) +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 69, 18)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 69, 31)) +} + + +interface I13 { +>I13 : Symbol(I13, Decl(anyAssignableToEveryType2.ts, 71, 1)) + + [x: string]: (x: T) => T; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 75, 5)) +>T : Symbol(T, Decl(anyAssignableToEveryType2.ts, 75, 18)) +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 75, 21)) +>T : Symbol(T, Decl(anyAssignableToEveryType2.ts, 75, 18)) +>T : Symbol(T, Decl(anyAssignableToEveryType2.ts, 75, 18)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 75, 32)) +} + + +enum E { A } +>E : Symbol(E, Decl(anyAssignableToEveryType2.ts, 77, 1)) +>A : Symbol(E.A, Decl(anyAssignableToEveryType2.ts, 80, 8)) + +interface I14 { +>I14 : Symbol(I14, Decl(anyAssignableToEveryType2.ts, 80, 12)) + + [x: string]: E; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 82, 5)) +>E : Symbol(E, Decl(anyAssignableToEveryType2.ts, 77, 1)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 82, 19)) +} + + +function f() { } +>f : Symbol(f, Decl(anyAssignableToEveryType2.ts, 84, 1), Decl(anyAssignableToEveryType2.ts, 87, 16)) + +module f { +>f : Symbol(f, Decl(anyAssignableToEveryType2.ts, 84, 1), Decl(anyAssignableToEveryType2.ts, 87, 16)) + + export var bar = 1; +>bar : Symbol(bar, Decl(anyAssignableToEveryType2.ts, 89, 14)) +} +interface I15 { +>I15 : Symbol(I15, Decl(anyAssignableToEveryType2.ts, 90, 1)) + + [x: string]: typeof f; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 92, 5)) +>f : Symbol(f, Decl(anyAssignableToEveryType2.ts, 84, 1), Decl(anyAssignableToEveryType2.ts, 87, 16)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 92, 26)) +} + + +class c { baz: string } +>c : Symbol(c, Decl(anyAssignableToEveryType2.ts, 94, 1), Decl(anyAssignableToEveryType2.ts, 97, 23)) +>baz : Symbol(baz, Decl(anyAssignableToEveryType2.ts, 97, 9)) + +module c { +>c : Symbol(c, Decl(anyAssignableToEveryType2.ts, 94, 1), Decl(anyAssignableToEveryType2.ts, 97, 23)) + + export var bar = 1; +>bar : Symbol(bar, Decl(anyAssignableToEveryType2.ts, 99, 14)) +} +interface I16 { +>I16 : Symbol(I16, Decl(anyAssignableToEveryType2.ts, 100, 1)) + + [x: string]: typeof c; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 102, 5)) +>c : Symbol(c, Decl(anyAssignableToEveryType2.ts, 94, 1), Decl(anyAssignableToEveryType2.ts, 97, 23)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 102, 26)) +} + + +interface I17 { +>I17 : Symbol(I17, Decl(anyAssignableToEveryType2.ts, 104, 1)) +>T : Symbol(T, Decl(anyAssignableToEveryType2.ts, 107, 14)) + + [x: string]: T; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 108, 5)) +>T : Symbol(T, Decl(anyAssignableToEveryType2.ts, 107, 14)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 108, 19)) +} + + +interface I18 { +>I18 : Symbol(I18, Decl(anyAssignableToEveryType2.ts, 110, 1)) +>T : Symbol(T, Decl(anyAssignableToEveryType2.ts, 113, 14)) +>U : Symbol(U, Decl(anyAssignableToEveryType2.ts, 113, 16)) +>T : Symbol(T, Decl(anyAssignableToEveryType2.ts, 113, 14)) + + [x: string]: U; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 114, 5)) +>U : Symbol(U, Decl(anyAssignableToEveryType2.ts, 113, 16)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 114, 19)) +} + + +interface I19 { +>I19 : Symbol(I19, Decl(anyAssignableToEveryType2.ts, 116, 1)) + + [x: string]: Object; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 120, 5)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 120, 24)) +} + + +interface I20 { +>I20 : Symbol(I20, Decl(anyAssignableToEveryType2.ts, 122, 1)) + + [x: string]: {}; +>x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 126, 5)) + + foo: any; +>foo : Symbol(foo, Decl(anyAssignableToEveryType2.ts, 126, 20)) +} + diff --git a/tests/baselines/reference/anyAssignableToEveryType2.types b/tests/baselines/reference/anyAssignableToEveryType2.types new file mode 100644 index 0000000000000..b3f54211601a0 --- /dev/null +++ b/tests/baselines/reference/anyAssignableToEveryType2.types @@ -0,0 +1,276 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/anyAssignableToEveryType2.ts === +// any is not a subtype of any other types, but is assignable, all the below should work + +interface I { +>I : I + + [x: string]: any; +>x : string + + foo: any; // ok, any identical to itself +>foo : any +} + + +interface I2 { +>I2 : I2 + + [x: string]: number; +>x : string + + foo: any; +>foo : any +} + + +interface I3 { +>I3 : I3 + + [x: string]: string; +>x : string + + foo: any; +>foo : any +} + + +interface I4 { +>I4 : I4 + + [x: string]: boolean; +>x : string + + foo: any; +>foo : any +} + + +interface I5 { +>I5 : I5 + + [x: string]: Date; +>x : string +>Date : Date + + foo: any; +>foo : any +} + + +interface I6 { +>I6 : I6 + + [x: string]: RegExp; +>x : string +>RegExp : RegExp + + foo: any; +>foo : any +} + + +interface I7 { +>I7 : I7 + + [x: string]: { bar: number }; +>x : string +>bar : number + + foo: any; +>foo : any +} + + +interface I8 { +>I8 : I8 + + [x: string]: number[]; +>x : string + + foo: any; +>foo : any +} + + +interface I9 { +>I9 : I9 + + [x: string]: I8; +>x : string +>I8 : I8 + + foo: any; +>foo : any +} + +class A { foo: number; } +>A : A +>foo : number + +interface I10 { +>I10 : I10 + + [x: string]: A; +>x : string +>A : A + + foo: any; +>foo : any +} + +class A2 { foo: T; } +>A2 : A2 +>T : T +>foo : T +>T : T + +interface I11 { +>I11 : I11 + + [x: string]: A2; +>x : string +>A2 : A2 + + foo: any; +>foo : any +} + + +interface I12 { +>I12 : I12 + + [x: string]: (x) => number; +>x : string +>x : any + + foo: any; +>foo : any +} + + +interface I13 { +>I13 : I13 + + [x: string]: (x: T) => T; +>x : string +>T : T +>x : T +>T : T +>T : T + + foo: any; +>foo : any +} + + +enum E { A } +>E : E +>A : E + +interface I14 { +>I14 : I14 + + [x: string]: E; +>x : string +>E : E + + foo: any; +>foo : any +} + + +function f() { } +>f : typeof f + +module f { +>f : typeof f + + export var bar = 1; +>bar : number +>1 : number +} +interface I15 { +>I15 : I15 + + [x: string]: typeof f; +>x : string +>f : typeof f + + foo: any; +>foo : any +} + + +class c { baz: string } +>c : c +>baz : string + +module c { +>c : typeof c + + export var bar = 1; +>bar : number +>1 : number +} +interface I16 { +>I16 : I16 + + [x: string]: typeof c; +>x : string +>c : typeof c + + foo: any; +>foo : any +} + + +interface I17 { +>I17 : I17 +>T : T + + [x: string]: T; +>x : string +>T : T + + foo: any; +>foo : any +} + + +interface I18 { +>I18 : I18 +>T : T +>U : U +>T : T + + [x: string]: U; +>x : string +>U : U + + foo: any; +>foo : any +} + + +interface I19 { +>I19 : I19 + + [x: string]: Object; +>x : string +>Object : Object + + foo: any; +>foo : any +} + + +interface I20 { +>I20 : I20 + + [x: string]: {}; +>x : string + + foo: any; +>foo : any +} + diff --git a/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt b/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt index c5492e42e4234..a7d1630c50e6d 100644 --- a/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt +++ b/tests/baselines/reference/assertInWrapSomeTypeParameter.errors.txt @@ -1,11 +1,8 @@ -tests/cases/compiler/assertInWrapSomeTypeParameter.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/compiler/assertInWrapSomeTypeParameter.ts(2,26): error TS1005: '>' expected. -==== tests/cases/compiler/assertInWrapSomeTypeParameter.ts (2 errors) ==== +==== tests/cases/compiler/assertInWrapSomeTypeParameter.ts (1 errors) ==== class C> { - ~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo>(x: U) { ~ !!! error TS1005: '>' expected. diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt deleted file mode 100644 index bc82b0fa69cac..0000000000000 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.errors.txt +++ /dev/null @@ -1,22 +0,0 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts(7,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts(8,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts (2 errors) ==== - // some complex cases of assignment compat of generic signatures. - - interface I2 { - p: T - } - - var x: >(z: T) => void - ~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var y: >>(z: T) => void - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - // These both do not make sense as we would eventually be comparing I2 to I2>, and they are self referencing anyway - x = y - y = x - \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.symbols b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.symbols new file mode 100644 index 0000000000000..bcea8fbbb2788 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts === +// some complex cases of assignment compat of generic signatures. + +interface I2 { +>I2 : Symbol(I2, Decl(assignmentCompatWithGenericCallSignatures4.ts, 0, 0)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures4.ts, 2, 13)) + + p: T +>p : Symbol(p, Decl(assignmentCompatWithGenericCallSignatures4.ts, 2, 17)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures4.ts, 2, 13)) +} + +var x: >(z: T) => void +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures4.ts, 6, 3)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures4.ts, 6, 8)) +>I2 : Symbol(I2, Decl(assignmentCompatWithGenericCallSignatures4.ts, 0, 0)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures4.ts, 6, 8)) +>z : Symbol(z, Decl(assignmentCompatWithGenericCallSignatures4.ts, 6, 25)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures4.ts, 6, 8)) + +var y: >>(z: T) => void +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures4.ts, 7, 3)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures4.ts, 7, 8)) +>I2 : Symbol(I2, Decl(assignmentCompatWithGenericCallSignatures4.ts, 0, 0)) +>I2 : Symbol(I2, Decl(assignmentCompatWithGenericCallSignatures4.ts, 0, 0)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures4.ts, 7, 8)) +>z : Symbol(z, Decl(assignmentCompatWithGenericCallSignatures4.ts, 7, 29)) +>T : Symbol(T, Decl(assignmentCompatWithGenericCallSignatures4.ts, 7, 8)) + +// These both do not make sense as we would eventually be comparing I2 to I2>, and they are self referencing anyway +x = y +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures4.ts, 6, 3)) +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures4.ts, 7, 3)) + +y = x +>y : Symbol(y, Decl(assignmentCompatWithGenericCallSignatures4.ts, 7, 3)) +>x : Symbol(x, Decl(assignmentCompatWithGenericCallSignatures4.ts, 6, 3)) + diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.types b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.types new file mode 100644 index 0000000000000..38485a7846388 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.types @@ -0,0 +1,40 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithGenericCallSignatures4.ts === +// some complex cases of assignment compat of generic signatures. + +interface I2 { +>I2 : I2 +>T : T + + p: T +>p : T +>T : T +} + +var x: >(z: T) => void +>x : >(z: T) => void +>T : T +>I2 : I2 +>T : T +>z : T +>T : T + +var y: >>(z: T) => void +>y : >>(z: T) => void +>T : T +>I2 : I2 +>I2 : I2 +>T : T +>z : T +>T : T + +// These both do not make sense as we would eventually be comparing I2 to I2>, and they are self referencing anyway +x = y +>x = y : >>(z: T) => void +>x : >(z: T) => void +>y : >>(z: T) => void + +y = x +>y = x : >(z: T) => void +>y : >>(z: T) => void +>x : >(z: T) => void + diff --git a/tests/baselines/reference/assignmentStricterConstraints.errors.txt b/tests/baselines/reference/assignmentStricterConstraints.errors.txt deleted file mode 100644 index bf3751dda742c..0000000000000 --- a/tests/baselines/reference/assignmentStricterConstraints.errors.txt +++ /dev/null @@ -1,18 +0,0 @@ -tests/cases/compiler/assignmentStricterConstraints.ts(1,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/assignmentStricterConstraints.ts(2,5): error TS2322: Type 'S' is not assignable to type 'T'. - - -==== tests/cases/compiler/assignmentStricterConstraints.ts (2 errors) ==== - var f = function (x: T, y: S): void { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - x = y - ~ -!!! error TS2322: Type 'S' is not assignable to type 'T'. - } - - var g = function (x: T, y: S): void { } - - g = f - g(1, "") - \ No newline at end of file diff --git a/tests/baselines/reference/assignmentStricterConstraints.symbols b/tests/baselines/reference/assignmentStricterConstraints.symbols new file mode 100644 index 0000000000000..aba29bf3e5b26 --- /dev/null +++ b/tests/baselines/reference/assignmentStricterConstraints.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/assignmentStricterConstraints.ts === +var f = function (x: T, y: S): void { +>f : Symbol(f, Decl(assignmentStricterConstraints.ts, 0, 3)) +>T : Symbol(T, Decl(assignmentStricterConstraints.ts, 0, 18)) +>S : Symbol(S, Decl(assignmentStricterConstraints.ts, 0, 20)) +>T : Symbol(T, Decl(assignmentStricterConstraints.ts, 0, 18)) +>x : Symbol(x, Decl(assignmentStricterConstraints.ts, 0, 34)) +>T : Symbol(T, Decl(assignmentStricterConstraints.ts, 0, 18)) +>y : Symbol(y, Decl(assignmentStricterConstraints.ts, 0, 39)) +>S : Symbol(S, Decl(assignmentStricterConstraints.ts, 0, 20)) + + x = y +>x : Symbol(x, Decl(assignmentStricterConstraints.ts, 0, 34)) +>y : Symbol(y, Decl(assignmentStricterConstraints.ts, 0, 39)) +} + +var g = function (x: T, y: S): void { } +>g : Symbol(g, Decl(assignmentStricterConstraints.ts, 4, 3)) +>T : Symbol(T, Decl(assignmentStricterConstraints.ts, 4, 18)) +>S : Symbol(S, Decl(assignmentStricterConstraints.ts, 4, 20)) +>x : Symbol(x, Decl(assignmentStricterConstraints.ts, 4, 24)) +>T : Symbol(T, Decl(assignmentStricterConstraints.ts, 4, 18)) +>y : Symbol(y, Decl(assignmentStricterConstraints.ts, 4, 29)) +>S : Symbol(S, Decl(assignmentStricterConstraints.ts, 4, 20)) + +g = f +>g : Symbol(g, Decl(assignmentStricterConstraints.ts, 4, 3)) +>f : Symbol(f, Decl(assignmentStricterConstraints.ts, 0, 3)) + +g(1, "") +>g : Symbol(g, Decl(assignmentStricterConstraints.ts, 4, 3)) + diff --git a/tests/baselines/reference/assignmentStricterConstraints.types b/tests/baselines/reference/assignmentStricterConstraints.types new file mode 100644 index 0000000000000..3a72d92f51c06 --- /dev/null +++ b/tests/baselines/reference/assignmentStricterConstraints.types @@ -0,0 +1,39 @@ +=== tests/cases/compiler/assignmentStricterConstraints.ts === +var f = function (x: T, y: S): void { +>f : (x: T, y: S) => void +>function (x: T, y: S): void { x = y} : (x: T, y: S) => void +>T : T +>S : S +>T : T +>x : T +>T : T +>y : S +>S : S + + x = y +>x = y : S +>x : T +>y : S +} + +var g = function (x: T, y: S): void { } +>g : (x: T, y: S) => void +>function (x: T, y: S): void { } : (x: T, y: S) => void +>T : T +>S : S +>x : T +>T : T +>y : S +>S : S + +g = f +>g = f : (x: T, y: S) => void +>g : (x: T, y: S) => void +>f : (x: T, y: S) => void + +g(1, "") +>g(1, "") : void +>g : (x: T, y: S) => void +>1 : number +>"" : string + diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt deleted file mode 100644 index 83f4678c8f3ae..0000000000000 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.errors.txt +++ /dev/null @@ -1,36 +0,0 @@ -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts(18,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts(22,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts(22,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts (3 errors) ==== - // conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) - // these are errors - - class Base { foo: string; } - class Derived extends Base { bar: string; } - class Derived2 extends Base { baz: string; } - var base: Base; - var derived: Derived; - var derived2: Derived2; - - var r2 = true ? 1 : ''; - var r9 = true ? derived : derived2; - - function foo(t: T, u: U) { - return true ? t : u; - } - - function foo2(t: T, u: U) { // Error for referencing own type parameter - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - return true ? t : u; // Ok because BCT(T, U) = U - } - - function foo3(t: T, u: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - return true ? t : u; - } \ No newline at end of file diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.symbols b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.symbols new file mode 100644 index 0000000000000..68103761051e1 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.symbols @@ -0,0 +1,83 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts === +// conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) +// these are errors + +class Base { foo: string; } +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions2.ts, 0, 0)) +>foo : Symbol(foo, Decl(bestCommonTypeOfConditionalExpressions2.ts, 3, 12)) + +class Derived extends Base { bar: string; } +>Derived : Symbol(Derived, Decl(bestCommonTypeOfConditionalExpressions2.ts, 3, 27)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions2.ts, 0, 0)) +>bar : Symbol(bar, Decl(bestCommonTypeOfConditionalExpressions2.ts, 4, 28)) + +class Derived2 extends Base { baz: string; } +>Derived2 : Symbol(Derived2, Decl(bestCommonTypeOfConditionalExpressions2.ts, 4, 43)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions2.ts, 0, 0)) +>baz : Symbol(baz, Decl(bestCommonTypeOfConditionalExpressions2.ts, 5, 29)) + +var base: Base; +>base : Symbol(base, Decl(bestCommonTypeOfConditionalExpressions2.ts, 6, 3)) +>Base : Symbol(Base, Decl(bestCommonTypeOfConditionalExpressions2.ts, 0, 0)) + +var derived: Derived; +>derived : Symbol(derived, Decl(bestCommonTypeOfConditionalExpressions2.ts, 7, 3)) +>Derived : Symbol(Derived, Decl(bestCommonTypeOfConditionalExpressions2.ts, 3, 27)) + +var derived2: Derived2; +>derived2 : Symbol(derived2, Decl(bestCommonTypeOfConditionalExpressions2.ts, 8, 3)) +>Derived2 : Symbol(Derived2, Decl(bestCommonTypeOfConditionalExpressions2.ts, 4, 43)) + +var r2 = true ? 1 : ''; +>r2 : Symbol(r2, Decl(bestCommonTypeOfConditionalExpressions2.ts, 10, 3)) + +var r9 = true ? derived : derived2; +>r9 : Symbol(r9, Decl(bestCommonTypeOfConditionalExpressions2.ts, 11, 3)) +>derived : Symbol(derived, Decl(bestCommonTypeOfConditionalExpressions2.ts, 7, 3)) +>derived2 : Symbol(derived2, Decl(bestCommonTypeOfConditionalExpressions2.ts, 8, 3)) + +function foo(t: T, u: U) { +>foo : Symbol(foo, Decl(bestCommonTypeOfConditionalExpressions2.ts, 11, 35)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions2.ts, 13, 13)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions2.ts, 13, 15)) +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions2.ts, 13, 19)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions2.ts, 13, 13)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions2.ts, 13, 24)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions2.ts, 13, 15)) + + return true ? t : u; +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions2.ts, 13, 19)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions2.ts, 13, 24)) +} + +function foo2(t: T, u: U) { // Error for referencing own type parameter +>foo2 : Symbol(foo2, Decl(bestCommonTypeOfConditionalExpressions2.ts, 15, 1)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions2.ts, 17, 14)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions2.ts, 17, 26)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions2.ts, 17, 26)) +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions2.ts, 17, 30)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions2.ts, 17, 14)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions2.ts, 17, 35)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions2.ts, 17, 26)) + + return true ? t : u; // Ok because BCT(T, U) = U +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions2.ts, 17, 30)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions2.ts, 17, 35)) +} + +function foo3(t: T, u: U) { +>foo3 : Symbol(foo3, Decl(bestCommonTypeOfConditionalExpressions2.ts, 19, 1)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 14)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 26)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 26)) +>V : Symbol(V, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 39)) +>V : Symbol(V, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 39)) +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 43)) +>T : Symbol(T, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 14)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 48)) +>U : Symbol(U, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 26)) + + return true ? t : u; +>t : Symbol(t, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 43)) +>u : Symbol(u, Decl(bestCommonTypeOfConditionalExpressions2.ts, 21, 48)) +} diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types new file mode 100644 index 0000000000000..ef9ecfb2a1190 --- /dev/null +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types @@ -0,0 +1,95 @@ +=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfConditionalExpressions2.ts === +// conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) +// these are errors + +class Base { foo: string; } +>Base : Base +>foo : string + +class Derived extends Base { bar: string; } +>Derived : Derived +>Base : Base +>bar : string + +class Derived2 extends Base { baz: string; } +>Derived2 : Derived2 +>Base : Base +>baz : string + +var base: Base; +>base : Base +>Base : Base + +var derived: Derived; +>derived : Derived +>Derived : Derived + +var derived2: Derived2; +>derived2 : Derived2 +>Derived2 : Derived2 + +var r2 = true ? 1 : ''; +>r2 : number | string +>true ? 1 : '' : number | string +>true : boolean +>1 : number +>'' : string + +var r9 = true ? derived : derived2; +>r9 : Derived | Derived2 +>true ? derived : derived2 : Derived | Derived2 +>true : boolean +>derived : Derived +>derived2 : Derived2 + +function foo(t: T, u: U) { +>foo : (t: T, u: U) => T | U +>T : T +>U : U +>t : T +>T : T +>u : U +>U : U + + return true ? t : u; +>true ? t : u : T | U +>true : boolean +>t : T +>u : U +} + +function foo2(t: T, u: U) { // Error for referencing own type parameter +>foo2 : (t: T, u: U) => U +>T : T +>U : U +>U : U +>t : T +>T : T +>u : U +>U : U + + return true ? t : u; // Ok because BCT(T, U) = U +>true ? t : u : U +>true : boolean +>t : T +>u : U +} + +function foo3(t: T, u: U) { +>foo3 : (t: T, u: U) => U +>T : T +>U : U +>U : U +>V : V +>V : V +>t : T +>T : T +>u : U +>U : U + + return true ? t : u; +>true ? t : u : U +>true : boolean +>t : T +>u : U +} diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt deleted file mode 100644 index 908f97345a119..0000000000000 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.errors.txt +++ /dev/null @@ -1,155 +0,0 @@ -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts(28,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts (1 errors) ==== - class Base { - public a: string; - } - - class Derived extends Base { - public b: string; - } - - class C { - public c: string; - } - - var a1: { fn(x: T): T }; - var b1: { fn(): string }; - - var a2: { fn(x: T): T }; - var b2: { fn(x: string): number }; - - var a3: { fn(x?: T): T }; - var b3: { fn(x?: string): number }; - - var a4: { fn(...x: T[]): T }; - var b4: { fn(...x: string[]): number }; - - var a5: { fn(x: T, y: T): T }; - var b5: { fn(x: string, y: number): string }; - - var a6: { fn(x: T, y: U): T }; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var b6: { fn(x: Base, y: C): Base }; - - // operator < - var r1a1 = a1 < b1; - var r1a2 = a2 < b2; - var r1a3 = a3 < b3; - var r1a4 = a4 < b4; - var r1a5 = a5 < b5; - var r1a6 = a6 < b6; - - var r1b1 = b1 < a1; - var r1b2 = b2 < a2; - var r1b3 = b3 < a3; - var r1b4 = b4 < a4; - var r1b5 = b5 < a5; - var r1b6 = b6 < a6; - - // operator > - var r2a1 = a1 > b1; - var r2a2 = a2 > b2; - var r2a3 = a3 > b3; - var r2a4 = a4 > b4; - var r2a5 = a5 > b5; - var r2a6 = a6 > b6; - - var r2b1 = b1 > a1; - var r2b2 = b2 > a2; - var r2b3 = b3 > a3; - var r2b4 = b4 > a4; - var r2b5 = b5 > a5; - var r2b6 = b6 > a6; - - // operator <= - var r3a1 = a1 <= b1; - var r3a2 = a2 <= b2; - var r3a3 = a3 <= b3; - var r3a4 = a4 <= b4; - var r3a5 = a5 <= b5; - var r3a6 = a6 <= b6; - - var r3b1 = b1 <= a1; - var r3b2 = b2 <= a2; - var r3b3 = b3 <= a3; - var r3b4 = b4 <= a4; - var r3b5 = b5 <= a5; - var r3b6 = b6 <= a6; - - // operator >= - var r4a1 = a1 >= b1; - var r4a2 = a2 >= b2; - var r4a3 = a3 >= b3; - var r4a4 = a4 >= b4; - var r4a5 = a5 >= b5; - var r4a6 = a6 >= b6; - - var r4b1 = b1 >= a1; - var r4b2 = b2 >= a2; - var r4b3 = b3 >= a3; - var r4b4 = b4 >= a4; - var r4b5 = b5 >= a5; - var r4b6 = b6 >= a6; - - // operator == - var r5a1 = a1 == b1; - var r5a2 = a2 == b2; - var r5a3 = a3 == b3; - var r5a4 = a4 == b4; - var r5a5 = a5 == b5; - var r5a6 = a6 == b6; - - var r5b1 = b1 == a1; - var r5b2 = b2 == a2; - var r5b3 = b3 == a3; - var r5b4 = b4 == a4; - var r5b5 = b5 == a5; - var r5b6 = b6 == a6; - - // operator != - var r6a1 = a1 != b1; - var r6a2 = a2 != b2; - var r6a3 = a3 != b3; - var r6a4 = a4 != b4; - var r6a5 = a5 != b5; - var r6a6 = a6 != b6; - - var r6b1 = b1 != a1; - var r6b2 = b2 != a2; - var r6b3 = b3 != a3; - var r6b4 = b4 != a4; - var r6b5 = b5 != a5; - var r6b6 = b6 != a6; - - // operator === - var r7a1 = a1 === b1; - var r7a2 = a2 === b2; - var r7a3 = a3 === b3; - var r7a4 = a4 === b4; - var r7a5 = a5 === b5; - var r7a6 = a6 === b6; - - var r7b1 = b1 === a1; - var r7b2 = b2 === a2; - var r7b3 = b3 === a3; - var r7b4 = b4 === a4; - var r7b5 = b5 === a5; - var r7b6 = b6 === a6; - - // operator !== - var r8a1 = a1 !== b1; - var r8a2 = a2 !== b2; - var r8a3 = a3 !== b3; - var r8a4 = a4 !== b4; - var r8a5 = a5 !== b5; - var r8a6 = a6 !== b6; - - var r8b1 = b1 !== a1; - var r8b2 = b2 !== a2; - var r8b3 = b3 !== a3; - var r8b4 = b4 !== a4; - var r8b5 = b5 !== a5; - var r8b6 = b6 !== a6; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.symbols b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.symbols new file mode 100644 index 0000000000000..ef92cdd676a1e --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.symbols @@ -0,0 +1,599 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 4, 28)) +} + +class C { +>C : Symbol(C, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 6, 1)) + + public c: string; +>c : Symbol(c, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 8, 9)) +} + +var a1: { fn(x: T): T }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 13)) + +var b1: { fn(): string }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 9)) + +var a2: { fn(x: T): T }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 13)) + +var b2: { fn(x: string): number }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 13)) + +var a3: { fn(x?: T): T }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 13)) + +var b3: { fn(x?: string): number }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 13)) + +var a4: { fn(...x: T[]): T }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 13)) + +var b4: { fn(...x: string[]): number }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 13)) + +var a5: { fn(x: T, y: T): T }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 16)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 21)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 13)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 13)) + +var b5: { fn(x: string, y: number): string }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 23)) + +var a6: { fn(x: T, y: U): T }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 9)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 13)) +>U : Symbol(U, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 13)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 29)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 13)) +>y : Symbol(y, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 34)) +>U : Symbol(U, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 13)) + +var b6: { fn(x: Base, y: C): Base }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) +>fn : Symbol(fn, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 9)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 13)) +>Base : Symbol(Base, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 0, 0)) +>y : Symbol(y, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 21)) +>C : Symbol(C, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 6, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 0, 0)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 31, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 32, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 33, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 34, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 35, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 36, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 38, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 39, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 40, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 41, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 42, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 43, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 46, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 47, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 48, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 49, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 50, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 51, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 53, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 54, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 55, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 56, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 57, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 58, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 61, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 62, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 63, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 64, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 65, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 66, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 68, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 69, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 70, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 71, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 72, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 73, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 76, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 77, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 78, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 79, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 80, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 81, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 83, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 84, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 85, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 86, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 87, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 88, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 91, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 92, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 93, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 94, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 95, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 96, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 98, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 99, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 100, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 101, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 102, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 103, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 106, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 107, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 108, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 109, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 110, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 111, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 113, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 114, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 115, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 116, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 117, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 118, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 121, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 122, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 123, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 124, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 125, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 126, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 128, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 129, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 130, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 131, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 132, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 133, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 136, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 137, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 138, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 139, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 140, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 141, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 143, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 12, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 144, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 15, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 145, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 18, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 146, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 21, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 147, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 24, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 148, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts, 27, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.types b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.types new file mode 100644 index 0000000000000..d1e7b6c78dab4 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.types @@ -0,0 +1,695 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.ts === +class Base { +>Base : Base + + public a: string; +>a : string +} + +class Derived extends Base { +>Derived : Derived +>Base : Base + + public b: string; +>b : string +} + +class C { +>C : C + + public c: string; +>c : string +} + +var a1: { fn(x: T): T }; +>a1 : { fn(x: T): T; } +>fn : (x: T) => T +>T : T +>x : T +>T : T +>T : T + +var b1: { fn(): string }; +>b1 : { fn(): string; } +>fn : () => string + +var a2: { fn(x: T): T }; +>a2 : { fn(x: T): T; } +>fn : (x: T) => T +>T : T +>x : T +>T : T +>T : T + +var b2: { fn(x: string): number }; +>b2 : { fn(x: string): number; } +>fn : (x: string) => number +>x : string + +var a3: { fn(x?: T): T }; +>a3 : { fn(x?: T): T; } +>fn : (x?: T) => T +>T : T +>x : T +>T : T +>T : T + +var b3: { fn(x?: string): number }; +>b3 : { fn(x?: string): number; } +>fn : (x?: string) => number +>x : string + +var a4: { fn(...x: T[]): T }; +>a4 : { fn(...x: T[]): T; } +>fn : (...x: T[]) => T +>T : T +>x : T[] +>T : T +>T : T + +var b4: { fn(...x: string[]): number }; +>b4 : { fn(...x: string[]): number; } +>fn : (...x: string[]) => number +>x : string[] + +var a5: { fn(x: T, y: T): T }; +>a5 : { fn(x: T, y: T): T; } +>fn : (x: T, y: T) => T +>T : T +>x : T +>T : T +>y : T +>T : T +>T : T + +var b5: { fn(x: string, y: number): string }; +>b5 : { fn(x: string, y: number): string; } +>fn : (x: string, y: number) => string +>x : string +>y : number + +var a6: { fn(x: T, y: U): T }; +>a6 : { fn(x: T, y: U): T; } +>fn : (x: T, y: U) => T +>T : T +>U : U +>T : T +>x : T +>T : T +>y : U +>U : U +>T : T + +var b6: { fn(x: Base, y: C): Base }; +>b6 : { fn(x: Base, y: C): Base; } +>fn : (x: Base, y: C) => Base +>x : Base +>Base : Base +>y : C +>C : C +>Base : Base + +// operator < +var r1a1 = a1 < b1; +>r1a1 : boolean +>a1 < b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(): string; } + +var r1a2 = a2 < b2; +>r1a2 : boolean +>a2 < b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string): number; } + +var r1a3 = a3 < b3; +>r1a3 : boolean +>a3 < b3 : boolean +>a3 : { fn(x?: T): T; } +>b3 : { fn(x?: string): number; } + +var r1a4 = a4 < b4; +>r1a4 : boolean +>a4 < b4 : boolean +>a4 : { fn(...x: T[]): T; } +>b4 : { fn(...x: string[]): number; } + +var r1a5 = a5 < b5; +>r1a5 : boolean +>a5 < b5 : boolean +>a5 : { fn(x: T, y: T): T; } +>b5 : { fn(x: string, y: number): string; } + +var r1a6 = a6 < b6; +>r1a6 : boolean +>a6 < b6 : boolean +>a6 : { fn(x: T, y: U): T; } +>b6 : { fn(x: Base, y: C): Base; } + +var r1b1 = b1 < a1; +>r1b1 : boolean +>b1 < a1 : boolean +>b1 : { fn(): string; } +>a1 : { fn(x: T): T; } + +var r1b2 = b2 < a2; +>r1b2 : boolean +>b2 < a2 : boolean +>b2 : { fn(x: string): number; } +>a2 : { fn(x: T): T; } + +var r1b3 = b3 < a3; +>r1b3 : boolean +>b3 < a3 : boolean +>b3 : { fn(x?: string): number; } +>a3 : { fn(x?: T): T; } + +var r1b4 = b4 < a4; +>r1b4 : boolean +>b4 < a4 : boolean +>b4 : { fn(...x: string[]): number; } +>a4 : { fn(...x: T[]): T; } + +var r1b5 = b5 < a5; +>r1b5 : boolean +>b5 < a5 : boolean +>b5 : { fn(x: string, y: number): string; } +>a5 : { fn(x: T, y: T): T; } + +var r1b6 = b6 < a6; +>r1b6 : boolean +>b6 < a6 : boolean +>b6 : { fn(x: Base, y: C): Base; } +>a6 : { fn(x: T, y: U): T; } + +// operator > +var r2a1 = a1 > b1; +>r2a1 : boolean +>a1 > b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(): string; } + +var r2a2 = a2 > b2; +>r2a2 : boolean +>a2 > b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string): number; } + +var r2a3 = a3 > b3; +>r2a3 : boolean +>a3 > b3 : boolean +>a3 : { fn(x?: T): T; } +>b3 : { fn(x?: string): number; } + +var r2a4 = a4 > b4; +>r2a4 : boolean +>a4 > b4 : boolean +>a4 : { fn(...x: T[]): T; } +>b4 : { fn(...x: string[]): number; } + +var r2a5 = a5 > b5; +>r2a5 : boolean +>a5 > b5 : boolean +>a5 : { fn(x: T, y: T): T; } +>b5 : { fn(x: string, y: number): string; } + +var r2a6 = a6 > b6; +>r2a6 : boolean +>a6 > b6 : boolean +>a6 : { fn(x: T, y: U): T; } +>b6 : { fn(x: Base, y: C): Base; } + +var r2b1 = b1 > a1; +>r2b1 : boolean +>b1 > a1 : boolean +>b1 : { fn(): string; } +>a1 : { fn(x: T): T; } + +var r2b2 = b2 > a2; +>r2b2 : boolean +>b2 > a2 : boolean +>b2 : { fn(x: string): number; } +>a2 : { fn(x: T): T; } + +var r2b3 = b3 > a3; +>r2b3 : boolean +>b3 > a3 : boolean +>b3 : { fn(x?: string): number; } +>a3 : { fn(x?: T): T; } + +var r2b4 = b4 > a4; +>r2b4 : boolean +>b4 > a4 : boolean +>b4 : { fn(...x: string[]): number; } +>a4 : { fn(...x: T[]): T; } + +var r2b5 = b5 > a5; +>r2b5 : boolean +>b5 > a5 : boolean +>b5 : { fn(x: string, y: number): string; } +>a5 : { fn(x: T, y: T): T; } + +var r2b6 = b6 > a6; +>r2b6 : boolean +>b6 > a6 : boolean +>b6 : { fn(x: Base, y: C): Base; } +>a6 : { fn(x: T, y: U): T; } + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : boolean +>a1 <= b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(): string; } + +var r3a2 = a2 <= b2; +>r3a2 : boolean +>a2 <= b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string): number; } + +var r3a3 = a3 <= b3; +>r3a3 : boolean +>a3 <= b3 : boolean +>a3 : { fn(x?: T): T; } +>b3 : { fn(x?: string): number; } + +var r3a4 = a4 <= b4; +>r3a4 : boolean +>a4 <= b4 : boolean +>a4 : { fn(...x: T[]): T; } +>b4 : { fn(...x: string[]): number; } + +var r3a5 = a5 <= b5; +>r3a5 : boolean +>a5 <= b5 : boolean +>a5 : { fn(x: T, y: T): T; } +>b5 : { fn(x: string, y: number): string; } + +var r3a6 = a6 <= b6; +>r3a6 : boolean +>a6 <= b6 : boolean +>a6 : { fn(x: T, y: U): T; } +>b6 : { fn(x: Base, y: C): Base; } + +var r3b1 = b1 <= a1; +>r3b1 : boolean +>b1 <= a1 : boolean +>b1 : { fn(): string; } +>a1 : { fn(x: T): T; } + +var r3b2 = b2 <= a2; +>r3b2 : boolean +>b2 <= a2 : boolean +>b2 : { fn(x: string): number; } +>a2 : { fn(x: T): T; } + +var r3b3 = b3 <= a3; +>r3b3 : boolean +>b3 <= a3 : boolean +>b3 : { fn(x?: string): number; } +>a3 : { fn(x?: T): T; } + +var r3b4 = b4 <= a4; +>r3b4 : boolean +>b4 <= a4 : boolean +>b4 : { fn(...x: string[]): number; } +>a4 : { fn(...x: T[]): T; } + +var r3b5 = b5 <= a5; +>r3b5 : boolean +>b5 <= a5 : boolean +>b5 : { fn(x: string, y: number): string; } +>a5 : { fn(x: T, y: T): T; } + +var r3b6 = b6 <= a6; +>r3b6 : boolean +>b6 <= a6 : boolean +>b6 : { fn(x: Base, y: C): Base; } +>a6 : { fn(x: T, y: U): T; } + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : boolean +>a1 >= b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(): string; } + +var r4a2 = a2 >= b2; +>r4a2 : boolean +>a2 >= b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string): number; } + +var r4a3 = a3 >= b3; +>r4a3 : boolean +>a3 >= b3 : boolean +>a3 : { fn(x?: T): T; } +>b3 : { fn(x?: string): number; } + +var r4a4 = a4 >= b4; +>r4a4 : boolean +>a4 >= b4 : boolean +>a4 : { fn(...x: T[]): T; } +>b4 : { fn(...x: string[]): number; } + +var r4a5 = a5 >= b5; +>r4a5 : boolean +>a5 >= b5 : boolean +>a5 : { fn(x: T, y: T): T; } +>b5 : { fn(x: string, y: number): string; } + +var r4a6 = a6 >= b6; +>r4a6 : boolean +>a6 >= b6 : boolean +>a6 : { fn(x: T, y: U): T; } +>b6 : { fn(x: Base, y: C): Base; } + +var r4b1 = b1 >= a1; +>r4b1 : boolean +>b1 >= a1 : boolean +>b1 : { fn(): string; } +>a1 : { fn(x: T): T; } + +var r4b2 = b2 >= a2; +>r4b2 : boolean +>b2 >= a2 : boolean +>b2 : { fn(x: string): number; } +>a2 : { fn(x: T): T; } + +var r4b3 = b3 >= a3; +>r4b3 : boolean +>b3 >= a3 : boolean +>b3 : { fn(x?: string): number; } +>a3 : { fn(x?: T): T; } + +var r4b4 = b4 >= a4; +>r4b4 : boolean +>b4 >= a4 : boolean +>b4 : { fn(...x: string[]): number; } +>a4 : { fn(...x: T[]): T; } + +var r4b5 = b5 >= a5; +>r4b5 : boolean +>b5 >= a5 : boolean +>b5 : { fn(x: string, y: number): string; } +>a5 : { fn(x: T, y: T): T; } + +var r4b6 = b6 >= a6; +>r4b6 : boolean +>b6 >= a6 : boolean +>b6 : { fn(x: Base, y: C): Base; } +>a6 : { fn(x: T, y: U): T; } + +// operator == +var r5a1 = a1 == b1; +>r5a1 : boolean +>a1 == b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(): string; } + +var r5a2 = a2 == b2; +>r5a2 : boolean +>a2 == b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string): number; } + +var r5a3 = a3 == b3; +>r5a3 : boolean +>a3 == b3 : boolean +>a3 : { fn(x?: T): T; } +>b3 : { fn(x?: string): number; } + +var r5a4 = a4 == b4; +>r5a4 : boolean +>a4 == b4 : boolean +>a4 : { fn(...x: T[]): T; } +>b4 : { fn(...x: string[]): number; } + +var r5a5 = a5 == b5; +>r5a5 : boolean +>a5 == b5 : boolean +>a5 : { fn(x: T, y: T): T; } +>b5 : { fn(x: string, y: number): string; } + +var r5a6 = a6 == b6; +>r5a6 : boolean +>a6 == b6 : boolean +>a6 : { fn(x: T, y: U): T; } +>b6 : { fn(x: Base, y: C): Base; } + +var r5b1 = b1 == a1; +>r5b1 : boolean +>b1 == a1 : boolean +>b1 : { fn(): string; } +>a1 : { fn(x: T): T; } + +var r5b2 = b2 == a2; +>r5b2 : boolean +>b2 == a2 : boolean +>b2 : { fn(x: string): number; } +>a2 : { fn(x: T): T; } + +var r5b3 = b3 == a3; +>r5b3 : boolean +>b3 == a3 : boolean +>b3 : { fn(x?: string): number; } +>a3 : { fn(x?: T): T; } + +var r5b4 = b4 == a4; +>r5b4 : boolean +>b4 == a4 : boolean +>b4 : { fn(...x: string[]): number; } +>a4 : { fn(...x: T[]): T; } + +var r5b5 = b5 == a5; +>r5b5 : boolean +>b5 == a5 : boolean +>b5 : { fn(x: string, y: number): string; } +>a5 : { fn(x: T, y: T): T; } + +var r5b6 = b6 == a6; +>r5b6 : boolean +>b6 == a6 : boolean +>b6 : { fn(x: Base, y: C): Base; } +>a6 : { fn(x: T, y: U): T; } + +// operator != +var r6a1 = a1 != b1; +>r6a1 : boolean +>a1 != b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(): string; } + +var r6a2 = a2 != b2; +>r6a2 : boolean +>a2 != b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string): number; } + +var r6a3 = a3 != b3; +>r6a3 : boolean +>a3 != b3 : boolean +>a3 : { fn(x?: T): T; } +>b3 : { fn(x?: string): number; } + +var r6a4 = a4 != b4; +>r6a4 : boolean +>a4 != b4 : boolean +>a4 : { fn(...x: T[]): T; } +>b4 : { fn(...x: string[]): number; } + +var r6a5 = a5 != b5; +>r6a5 : boolean +>a5 != b5 : boolean +>a5 : { fn(x: T, y: T): T; } +>b5 : { fn(x: string, y: number): string; } + +var r6a6 = a6 != b6; +>r6a6 : boolean +>a6 != b6 : boolean +>a6 : { fn(x: T, y: U): T; } +>b6 : { fn(x: Base, y: C): Base; } + +var r6b1 = b1 != a1; +>r6b1 : boolean +>b1 != a1 : boolean +>b1 : { fn(): string; } +>a1 : { fn(x: T): T; } + +var r6b2 = b2 != a2; +>r6b2 : boolean +>b2 != a2 : boolean +>b2 : { fn(x: string): number; } +>a2 : { fn(x: T): T; } + +var r6b3 = b3 != a3; +>r6b3 : boolean +>b3 != a3 : boolean +>b3 : { fn(x?: string): number; } +>a3 : { fn(x?: T): T; } + +var r6b4 = b4 != a4; +>r6b4 : boolean +>b4 != a4 : boolean +>b4 : { fn(...x: string[]): number; } +>a4 : { fn(...x: T[]): T; } + +var r6b5 = b5 != a5; +>r6b5 : boolean +>b5 != a5 : boolean +>b5 : { fn(x: string, y: number): string; } +>a5 : { fn(x: T, y: T): T; } + +var r6b6 = b6 != a6; +>r6b6 : boolean +>b6 != a6 : boolean +>b6 : { fn(x: Base, y: C): Base; } +>a6 : { fn(x: T, y: U): T; } + +// operator === +var r7a1 = a1 === b1; +>r7a1 : boolean +>a1 === b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(): string; } + +var r7a2 = a2 === b2; +>r7a2 : boolean +>a2 === b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string): number; } + +var r7a3 = a3 === b3; +>r7a3 : boolean +>a3 === b3 : boolean +>a3 : { fn(x?: T): T; } +>b3 : { fn(x?: string): number; } + +var r7a4 = a4 === b4; +>r7a4 : boolean +>a4 === b4 : boolean +>a4 : { fn(...x: T[]): T; } +>b4 : { fn(...x: string[]): number; } + +var r7a5 = a5 === b5; +>r7a5 : boolean +>a5 === b5 : boolean +>a5 : { fn(x: T, y: T): T; } +>b5 : { fn(x: string, y: number): string; } + +var r7a6 = a6 === b6; +>r7a6 : boolean +>a6 === b6 : boolean +>a6 : { fn(x: T, y: U): T; } +>b6 : { fn(x: Base, y: C): Base; } + +var r7b1 = b1 === a1; +>r7b1 : boolean +>b1 === a1 : boolean +>b1 : { fn(): string; } +>a1 : { fn(x: T): T; } + +var r7b2 = b2 === a2; +>r7b2 : boolean +>b2 === a2 : boolean +>b2 : { fn(x: string): number; } +>a2 : { fn(x: T): T; } + +var r7b3 = b3 === a3; +>r7b3 : boolean +>b3 === a3 : boolean +>b3 : { fn(x?: string): number; } +>a3 : { fn(x?: T): T; } + +var r7b4 = b4 === a4; +>r7b4 : boolean +>b4 === a4 : boolean +>b4 : { fn(...x: string[]): number; } +>a4 : { fn(...x: T[]): T; } + +var r7b5 = b5 === a5; +>r7b5 : boolean +>b5 === a5 : boolean +>b5 : { fn(x: string, y: number): string; } +>a5 : { fn(x: T, y: T): T; } + +var r7b6 = b6 === a6; +>r7b6 : boolean +>b6 === a6 : boolean +>b6 : { fn(x: Base, y: C): Base; } +>a6 : { fn(x: T, y: U): T; } + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : boolean +>a1 !== b1 : boolean +>a1 : { fn(x: T): T; } +>b1 : { fn(): string; } + +var r8a2 = a2 !== b2; +>r8a2 : boolean +>a2 !== b2 : boolean +>a2 : { fn(x: T): T; } +>b2 : { fn(x: string): number; } + +var r8a3 = a3 !== b3; +>r8a3 : boolean +>a3 !== b3 : boolean +>a3 : { fn(x?: T): T; } +>b3 : { fn(x?: string): number; } + +var r8a4 = a4 !== b4; +>r8a4 : boolean +>a4 !== b4 : boolean +>a4 : { fn(...x: T[]): T; } +>b4 : { fn(...x: string[]): number; } + +var r8a5 = a5 !== b5; +>r8a5 : boolean +>a5 !== b5 : boolean +>a5 : { fn(x: T, y: T): T; } +>b5 : { fn(x: string, y: number): string; } + +var r8a6 = a6 !== b6; +>r8a6 : boolean +>a6 !== b6 : boolean +>a6 : { fn(x: T, y: U): T; } +>b6 : { fn(x: Base, y: C): Base; } + +var r8b1 = b1 !== a1; +>r8b1 : boolean +>b1 !== a1 : boolean +>b1 : { fn(): string; } +>a1 : { fn(x: T): T; } + +var r8b2 = b2 !== a2; +>r8b2 : boolean +>b2 !== a2 : boolean +>b2 : { fn(x: string): number; } +>a2 : { fn(x: T): T; } + +var r8b3 = b3 !== a3; +>r8b3 : boolean +>b3 !== a3 : boolean +>b3 : { fn(x?: string): number; } +>a3 : { fn(x?: T): T; } + +var r8b4 = b4 !== a4; +>r8b4 : boolean +>b4 !== a4 : boolean +>b4 : { fn(...x: string[]): number; } +>a4 : { fn(...x: T[]): T; } + +var r8b5 = b5 !== a5; +>r8b5 : boolean +>b5 !== a5 : boolean +>b5 : { fn(x: string, y: number): string; } +>a5 : { fn(x: T, y: T): T; } + +var r8b6 = b6 !== a6; +>r8b6 : boolean +>b6 !== a6 : boolean +>b6 : { fn(x: Base, y: C): Base; } +>a6 : { fn(x: T, y: U): T; } + diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt deleted file mode 100644 index 5364fea089cb4..0000000000000 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.errors.txt +++ /dev/null @@ -1,155 +0,0 @@ -tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts(28,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts (1 errors) ==== - class Base { - public a: string; - } - - class Derived extends Base { - public b: string; - } - - class C { - public c: string; - } - - var a1: { new (x: T): T }; - var b1: { new (): string }; - - var a2: { new (x: T): T }; - var b2: { new (x: string): number }; - - var a3: { new (x?: T): T }; - var b3: { new (x?: string): number }; - - var a4: { new (...x: T[]): T }; - var b4: { new (...x: string[]): number }; - - var a5: { new (x: T, y: T): T }; - var b5: { new (x: string, y: number): string }; - - var a6: { new (x: T, y: U): T }; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var b6: { new (x: Base, y: C): Base }; - - // operator < - var r1a1 = a1 < b1; - var r1a2 = a2 < b2; - var r1a3 = a3 < b3; - var r1a4 = a4 < b4; - var r1a5 = a5 < b5; - var r1a6 = a6 < b6; - - var r1b1 = b1 < a1; - var r1b2 = b2 < a2; - var r1b3 = b3 < a3; - var r1b4 = b4 < a4; - var r1b5 = b5 < a5; - var r1b6 = b6 < a6; - - // operator > - var r2a1 = a1 > b1; - var r2a2 = a2 > b2; - var r2a3 = a3 > b3; - var r2a4 = a4 > b4; - var r2a5 = a5 > b5; - var r2a6 = a6 > b6; - - var r2b1 = b1 > a1; - var r2b2 = b2 > a2; - var r2b3 = b3 > a3; - var r2b4 = b4 > a4; - var r2b5 = b5 > a5; - var r2b6 = b6 > a6; - - // operator <= - var r3a1 = a1 <= b1; - var r3a2 = a2 <= b2; - var r3a3 = a3 <= b3; - var r3a4 = a4 <= b4; - var r3a5 = a5 <= b5; - var r3a6 = a6 <= b6; - - var r3b1 = b1 <= a1; - var r3b2 = b2 <= a2; - var r3b3 = b3 <= a3; - var r3b4 = b4 <= a4; - var r3b5 = b5 <= a5; - var r3b6 = b6 <= a6; - - // operator >= - var r4a1 = a1 >= b1; - var r4a2 = a2 >= b2; - var r4a3 = a3 >= b3; - var r4a4 = a4 >= b4; - var r4a5 = a5 >= b5; - var r4a6 = a6 >= b6; - - var r4b1 = b1 >= a1; - var r4b2 = b2 >= a2; - var r4b3 = b3 >= a3; - var r4b4 = b4 >= a4; - var r4b5 = b5 >= a5; - var r4b6 = b6 >= a6; - - // operator == - var r5a1 = a1 == b1; - var r5a2 = a2 == b2; - var r5a3 = a3 == b3; - var r5a4 = a4 == b4; - var r5a5 = a5 == b5; - var r5a6 = a6 == b6; - - var r5b1 = b1 == a1; - var r5b2 = b2 == a2; - var r5b3 = b3 == a3; - var r5b4 = b4 == a4; - var r5b5 = b5 == a5; - var r5b6 = b6 == a6; - - // operator != - var r6a1 = a1 != b1; - var r6a2 = a2 != b2; - var r6a3 = a3 != b3; - var r6a4 = a4 != b4; - var r6a5 = a5 != b5; - var r6a6 = a6 != b6; - - var r6b1 = b1 != a1; - var r6b2 = b2 != a2; - var r6b3 = b3 != a3; - var r6b4 = b4 != a4; - var r6b5 = b5 != a5; - var r6b6 = b6 != a6; - - // operator === - var r7a1 = a1 === b1; - var r7a2 = a2 === b2; - var r7a3 = a3 === b3; - var r7a4 = a4 === b4; - var r7a5 = a5 === b5; - var r7a6 = a6 === b6; - - var r7b1 = b1 === a1; - var r7b2 = b2 === a2; - var r7b3 = b3 === a3; - var r7b4 = b4 === a4; - var r7b5 = b5 === a5; - var r7b6 = b6 === a6; - - // operator !== - var r8a1 = a1 !== b1; - var r8a2 = a2 !== b2; - var r8a3 = a3 !== b3; - var r8a4 = a4 !== b4; - var r8a5 = a5 !== b5; - var r8a6 = a6 !== b6; - - var r8b1 = b1 !== a1; - var r8b2 = b2 !== a2; - var r8b3 = b3 !== a3; - var r8b4 = b4 !== a4; - var r8b5 = b5 !== a5; - var r8b6 = b6 !== a6; \ No newline at end of file diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.symbols b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.symbols new file mode 100644 index 0000000000000..08b23dac50a0a --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.symbols @@ -0,0 +1,587 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts === +class Base { +>Base : Symbol(Base, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 0, 0)) + + public a: string; +>a : Symbol(a, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 0, 12)) +} + +class Derived extends Base { +>Derived : Symbol(Derived, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 2, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 0, 0)) + + public b: string; +>b : Symbol(b, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 4, 28)) +} + +class C { +>C : Symbol(C, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 6, 1)) + + public c: string; +>c : Symbol(c, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 8, 9)) +} + +var a1: { new (x: T): T }; +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 15)) + +var b1: { new (): string }; +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) + +var a2: { new (x: T): T }; +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 15)) + +var b2: { new (x: string): number }; +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 15)) + +var a3: { new (x?: T): T }; +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 15)) + +var b3: { new (x?: string): number }; +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 15)) + +var a4: { new (...x: T[]): T }; +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 15)) + +var b4: { new (...x: string[]): number }; +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 15)) + +var a5: { new (x: T, y: T): T }; +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 18)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 23)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 15)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 15)) + +var b5: { new (x: string, y: number): string }; +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 25)) + +var a6: { new (x: T, y: U): T }; +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 15)) +>U : Symbol(U, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 17)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 15)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 31)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 15)) +>y : Symbol(y, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 36)) +>U : Symbol(U, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 17)) +>T : Symbol(T, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 15)) + +var b6: { new (x: Base, y: C): Base }; +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) +>x : Symbol(x, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 15)) +>Base : Symbol(Base, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 0, 0)) +>y : Symbol(y, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 23)) +>C : Symbol(C, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 6, 1)) +>Base : Symbol(Base, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 0, 0)) + +// operator < +var r1a1 = a1 < b1; +>r1a1 : Symbol(r1a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 31, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) + +var r1a2 = a2 < b2; +>r1a2 : Symbol(r1a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 32, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) + +var r1a3 = a3 < b3; +>r1a3 : Symbol(r1a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 33, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) + +var r1a4 = a4 < b4; +>r1a4 : Symbol(r1a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 34, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) + +var r1a5 = a5 < b5; +>r1a5 : Symbol(r1a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 35, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) + +var r1a6 = a6 < b6; +>r1a6 : Symbol(r1a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 36, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) + +var r1b1 = b1 < a1; +>r1b1 : Symbol(r1b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 38, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r1b2 = b2 < a2; +>r1b2 : Symbol(r1b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 39, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r1b3 = b3 < a3; +>r1b3 : Symbol(r1b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 40, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r1b4 = b4 < a4; +>r1b4 : Symbol(r1b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 41, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r1b5 = b5 < a5; +>r1b5 : Symbol(r1b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 42, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) + +var r1b6 = b6 < a6; +>r1b6 : Symbol(r1b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 43, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) + +// operator > +var r2a1 = a1 > b1; +>r2a1 : Symbol(r2a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 46, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) + +var r2a2 = a2 > b2; +>r2a2 : Symbol(r2a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 47, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) + +var r2a3 = a3 > b3; +>r2a3 : Symbol(r2a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 48, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) + +var r2a4 = a4 > b4; +>r2a4 : Symbol(r2a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 49, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) + +var r2a5 = a5 > b5; +>r2a5 : Symbol(r2a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 50, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) + +var r2a6 = a6 > b6; +>r2a6 : Symbol(r2a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 51, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) + +var r2b1 = b1 > a1; +>r2b1 : Symbol(r2b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 53, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r2b2 = b2 > a2; +>r2b2 : Symbol(r2b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 54, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r2b3 = b3 > a3; +>r2b3 : Symbol(r2b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 55, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r2b4 = b4 > a4; +>r2b4 : Symbol(r2b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 56, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r2b5 = b5 > a5; +>r2b5 : Symbol(r2b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 57, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) + +var r2b6 = b6 > a6; +>r2b6 : Symbol(r2b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 58, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : Symbol(r3a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 61, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) + +var r3a2 = a2 <= b2; +>r3a2 : Symbol(r3a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 62, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) + +var r3a3 = a3 <= b3; +>r3a3 : Symbol(r3a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 63, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) + +var r3a4 = a4 <= b4; +>r3a4 : Symbol(r3a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 64, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) + +var r3a5 = a5 <= b5; +>r3a5 : Symbol(r3a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 65, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) + +var r3a6 = a6 <= b6; +>r3a6 : Symbol(r3a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 66, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) + +var r3b1 = b1 <= a1; +>r3b1 : Symbol(r3b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 68, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r3b2 = b2 <= a2; +>r3b2 : Symbol(r3b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 69, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r3b3 = b3 <= a3; +>r3b3 : Symbol(r3b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 70, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r3b4 = b4 <= a4; +>r3b4 : Symbol(r3b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 71, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r3b5 = b5 <= a5; +>r3b5 : Symbol(r3b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 72, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) + +var r3b6 = b6 <= a6; +>r3b6 : Symbol(r3b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 73, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : Symbol(r4a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 76, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) + +var r4a2 = a2 >= b2; +>r4a2 : Symbol(r4a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 77, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) + +var r4a3 = a3 >= b3; +>r4a3 : Symbol(r4a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 78, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) + +var r4a4 = a4 >= b4; +>r4a4 : Symbol(r4a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 79, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) + +var r4a5 = a5 >= b5; +>r4a5 : Symbol(r4a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 80, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) + +var r4a6 = a6 >= b6; +>r4a6 : Symbol(r4a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 81, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) + +var r4b1 = b1 >= a1; +>r4b1 : Symbol(r4b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 83, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r4b2 = b2 >= a2; +>r4b2 : Symbol(r4b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 84, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r4b3 = b3 >= a3; +>r4b3 : Symbol(r4b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 85, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r4b4 = b4 >= a4; +>r4b4 : Symbol(r4b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 86, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r4b5 = b5 >= a5; +>r4b5 : Symbol(r4b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 87, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) + +var r4b6 = b6 >= a6; +>r4b6 : Symbol(r4b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 88, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) + +// operator == +var r5a1 = a1 == b1; +>r5a1 : Symbol(r5a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 91, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) + +var r5a2 = a2 == b2; +>r5a2 : Symbol(r5a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 92, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) + +var r5a3 = a3 == b3; +>r5a3 : Symbol(r5a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 93, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) + +var r5a4 = a4 == b4; +>r5a4 : Symbol(r5a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 94, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) + +var r5a5 = a5 == b5; +>r5a5 : Symbol(r5a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 95, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) + +var r5a6 = a6 == b6; +>r5a6 : Symbol(r5a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 96, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) + +var r5b1 = b1 == a1; +>r5b1 : Symbol(r5b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 98, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r5b2 = b2 == a2; +>r5b2 : Symbol(r5b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 99, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r5b3 = b3 == a3; +>r5b3 : Symbol(r5b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 100, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r5b4 = b4 == a4; +>r5b4 : Symbol(r5b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 101, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r5b5 = b5 == a5; +>r5b5 : Symbol(r5b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 102, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) + +var r5b6 = b6 == a6; +>r5b6 : Symbol(r5b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 103, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) + +// operator != +var r6a1 = a1 != b1; +>r6a1 : Symbol(r6a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 106, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) + +var r6a2 = a2 != b2; +>r6a2 : Symbol(r6a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 107, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) + +var r6a3 = a3 != b3; +>r6a3 : Symbol(r6a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 108, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) + +var r6a4 = a4 != b4; +>r6a4 : Symbol(r6a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 109, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) + +var r6a5 = a5 != b5; +>r6a5 : Symbol(r6a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 110, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) + +var r6a6 = a6 != b6; +>r6a6 : Symbol(r6a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 111, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) + +var r6b1 = b1 != a1; +>r6b1 : Symbol(r6b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 113, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r6b2 = b2 != a2; +>r6b2 : Symbol(r6b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 114, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r6b3 = b3 != a3; +>r6b3 : Symbol(r6b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 115, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r6b4 = b4 != a4; +>r6b4 : Symbol(r6b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 116, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r6b5 = b5 != a5; +>r6b5 : Symbol(r6b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 117, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) + +var r6b6 = b6 != a6; +>r6b6 : Symbol(r6b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 118, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) + +// operator === +var r7a1 = a1 === b1; +>r7a1 : Symbol(r7a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 121, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) + +var r7a2 = a2 === b2; +>r7a2 : Symbol(r7a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 122, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) + +var r7a3 = a3 === b3; +>r7a3 : Symbol(r7a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 123, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) + +var r7a4 = a4 === b4; +>r7a4 : Symbol(r7a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 124, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) + +var r7a5 = a5 === b5; +>r7a5 : Symbol(r7a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 125, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) + +var r7a6 = a6 === b6; +>r7a6 : Symbol(r7a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 126, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) + +var r7b1 = b1 === a1; +>r7b1 : Symbol(r7b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 128, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r7b2 = b2 === a2; +>r7b2 : Symbol(r7b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 129, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r7b3 = b3 === a3; +>r7b3 : Symbol(r7b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 130, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r7b4 = b4 === a4; +>r7b4 : Symbol(r7b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 131, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r7b5 = b5 === a5; +>r7b5 : Symbol(r7b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 132, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) + +var r7b6 = b6 === a6; +>r7b6 : Symbol(r7b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 133, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : Symbol(r8a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 136, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) + +var r8a2 = a2 !== b2; +>r8a2 : Symbol(r8a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 137, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) + +var r8a3 = a3 !== b3; +>r8a3 : Symbol(r8a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 138, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) + +var r8a4 = a4 !== b4; +>r8a4 : Symbol(r8a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 139, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) + +var r8a5 = a5 !== b5; +>r8a5 : Symbol(r8a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 140, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) + +var r8a6 = a6 !== b6; +>r8a6 : Symbol(r8a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 141, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) + +var r8b1 = b1 !== a1; +>r8b1 : Symbol(r8b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 143, 3)) +>b1 : Symbol(b1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 13, 3)) +>a1 : Symbol(a1, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 12, 3)) + +var r8b2 = b2 !== a2; +>r8b2 : Symbol(r8b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 144, 3)) +>b2 : Symbol(b2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 16, 3)) +>a2 : Symbol(a2, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 15, 3)) + +var r8b3 = b3 !== a3; +>r8b3 : Symbol(r8b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 145, 3)) +>b3 : Symbol(b3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 19, 3)) +>a3 : Symbol(a3, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 18, 3)) + +var r8b4 = b4 !== a4; +>r8b4 : Symbol(r8b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 146, 3)) +>b4 : Symbol(b4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 22, 3)) +>a4 : Symbol(a4, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 21, 3)) + +var r8b5 = b5 !== a5; +>r8b5 : Symbol(r8b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 147, 3)) +>b5 : Symbol(b5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 25, 3)) +>a5 : Symbol(a5, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 24, 3)) + +var r8b6 = b6 !== a6; +>r8b6 : Symbol(r8b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 148, 3)) +>b6 : Symbol(b6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 28, 3)) +>a6 : Symbol(a6, Decl(comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts, 27, 3)) + diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.types b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.types new file mode 100644 index 0000000000000..83cb431745963 --- /dev/null +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.types @@ -0,0 +1,683 @@ +=== tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.ts === +class Base { +>Base : Base + + public a: string; +>a : string +} + +class Derived extends Base { +>Derived : Derived +>Base : Base + + public b: string; +>b : string +} + +class C { +>C : C + + public c: string; +>c : string +} + +var a1: { new (x: T): T }; +>a1 : new (x: T) => T +>T : T +>x : T +>T : T +>T : T + +var b1: { new (): string }; +>b1 : new () => string + +var a2: { new (x: T): T }; +>a2 : new (x: T) => T +>T : T +>x : T +>T : T +>T : T + +var b2: { new (x: string): number }; +>b2 : new (x: string) => number +>x : string + +var a3: { new (x?: T): T }; +>a3 : new (x?: T) => T +>T : T +>x : T +>T : T +>T : T + +var b3: { new (x?: string): number }; +>b3 : new (x?: string) => number +>x : string + +var a4: { new (...x: T[]): T }; +>a4 : new (...x: T[]) => T +>T : T +>x : T[] +>T : T +>T : T + +var b4: { new (...x: string[]): number }; +>b4 : new (...x: string[]) => number +>x : string[] + +var a5: { new (x: T, y: T): T }; +>a5 : new (x: T, y: T) => T +>T : T +>x : T +>T : T +>y : T +>T : T +>T : T + +var b5: { new (x: string, y: number): string }; +>b5 : new (x: string, y: number) => string +>x : string +>y : number + +var a6: { new (x: T, y: U): T }; +>a6 : new (x: T, y: U) => T +>T : T +>U : U +>T : T +>x : T +>T : T +>y : U +>U : U +>T : T + +var b6: { new (x: Base, y: C): Base }; +>b6 : new (x: Base, y: C) => Base +>x : Base +>Base : Base +>y : C +>C : C +>Base : Base + +// operator < +var r1a1 = a1 < b1; +>r1a1 : boolean +>a1 < b1 : boolean +>a1 : new (x: T) => T +>b1 : new () => string + +var r1a2 = a2 < b2; +>r1a2 : boolean +>a2 < b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string) => number + +var r1a3 = a3 < b3; +>r1a3 : boolean +>a3 < b3 : boolean +>a3 : new (x?: T) => T +>b3 : new (x?: string) => number + +var r1a4 = a4 < b4; +>r1a4 : boolean +>a4 < b4 : boolean +>a4 : new (...x: T[]) => T +>b4 : new (...x: string[]) => number + +var r1a5 = a5 < b5; +>r1a5 : boolean +>a5 < b5 : boolean +>a5 : new (x: T, y: T) => T +>b5 : new (x: string, y: number) => string + +var r1a6 = a6 < b6; +>r1a6 : boolean +>a6 < b6 : boolean +>a6 : new (x: T, y: U) => T +>b6 : new (x: Base, y: C) => Base + +var r1b1 = b1 < a1; +>r1b1 : boolean +>b1 < a1 : boolean +>b1 : new () => string +>a1 : new (x: T) => T + +var r1b2 = b2 < a2; +>r1b2 : boolean +>b2 < a2 : boolean +>b2 : new (x: string) => number +>a2 : new (x: T) => T + +var r1b3 = b3 < a3; +>r1b3 : boolean +>b3 < a3 : boolean +>b3 : new (x?: string) => number +>a3 : new (x?: T) => T + +var r1b4 = b4 < a4; +>r1b4 : boolean +>b4 < a4 : boolean +>b4 : new (...x: string[]) => number +>a4 : new (...x: T[]) => T + +var r1b5 = b5 < a5; +>r1b5 : boolean +>b5 < a5 : boolean +>b5 : new (x: string, y: number) => string +>a5 : new (x: T, y: T) => T + +var r1b6 = b6 < a6; +>r1b6 : boolean +>b6 < a6 : boolean +>b6 : new (x: Base, y: C) => Base +>a6 : new (x: T, y: U) => T + +// operator > +var r2a1 = a1 > b1; +>r2a1 : boolean +>a1 > b1 : boolean +>a1 : new (x: T) => T +>b1 : new () => string + +var r2a2 = a2 > b2; +>r2a2 : boolean +>a2 > b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string) => number + +var r2a3 = a3 > b3; +>r2a3 : boolean +>a3 > b3 : boolean +>a3 : new (x?: T) => T +>b3 : new (x?: string) => number + +var r2a4 = a4 > b4; +>r2a4 : boolean +>a4 > b4 : boolean +>a4 : new (...x: T[]) => T +>b4 : new (...x: string[]) => number + +var r2a5 = a5 > b5; +>r2a5 : boolean +>a5 > b5 : boolean +>a5 : new (x: T, y: T) => T +>b5 : new (x: string, y: number) => string + +var r2a6 = a6 > b6; +>r2a6 : boolean +>a6 > b6 : boolean +>a6 : new (x: T, y: U) => T +>b6 : new (x: Base, y: C) => Base + +var r2b1 = b1 > a1; +>r2b1 : boolean +>b1 > a1 : boolean +>b1 : new () => string +>a1 : new (x: T) => T + +var r2b2 = b2 > a2; +>r2b2 : boolean +>b2 > a2 : boolean +>b2 : new (x: string) => number +>a2 : new (x: T) => T + +var r2b3 = b3 > a3; +>r2b3 : boolean +>b3 > a3 : boolean +>b3 : new (x?: string) => number +>a3 : new (x?: T) => T + +var r2b4 = b4 > a4; +>r2b4 : boolean +>b4 > a4 : boolean +>b4 : new (...x: string[]) => number +>a4 : new (...x: T[]) => T + +var r2b5 = b5 > a5; +>r2b5 : boolean +>b5 > a5 : boolean +>b5 : new (x: string, y: number) => string +>a5 : new (x: T, y: T) => T + +var r2b6 = b6 > a6; +>r2b6 : boolean +>b6 > a6 : boolean +>b6 : new (x: Base, y: C) => Base +>a6 : new (x: T, y: U) => T + +// operator <= +var r3a1 = a1 <= b1; +>r3a1 : boolean +>a1 <= b1 : boolean +>a1 : new (x: T) => T +>b1 : new () => string + +var r3a2 = a2 <= b2; +>r3a2 : boolean +>a2 <= b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string) => number + +var r3a3 = a3 <= b3; +>r3a3 : boolean +>a3 <= b3 : boolean +>a3 : new (x?: T) => T +>b3 : new (x?: string) => number + +var r3a4 = a4 <= b4; +>r3a4 : boolean +>a4 <= b4 : boolean +>a4 : new (...x: T[]) => T +>b4 : new (...x: string[]) => number + +var r3a5 = a5 <= b5; +>r3a5 : boolean +>a5 <= b5 : boolean +>a5 : new (x: T, y: T) => T +>b5 : new (x: string, y: number) => string + +var r3a6 = a6 <= b6; +>r3a6 : boolean +>a6 <= b6 : boolean +>a6 : new (x: T, y: U) => T +>b6 : new (x: Base, y: C) => Base + +var r3b1 = b1 <= a1; +>r3b1 : boolean +>b1 <= a1 : boolean +>b1 : new () => string +>a1 : new (x: T) => T + +var r3b2 = b2 <= a2; +>r3b2 : boolean +>b2 <= a2 : boolean +>b2 : new (x: string) => number +>a2 : new (x: T) => T + +var r3b3 = b3 <= a3; +>r3b3 : boolean +>b3 <= a3 : boolean +>b3 : new (x?: string) => number +>a3 : new (x?: T) => T + +var r3b4 = b4 <= a4; +>r3b4 : boolean +>b4 <= a4 : boolean +>b4 : new (...x: string[]) => number +>a4 : new (...x: T[]) => T + +var r3b5 = b5 <= a5; +>r3b5 : boolean +>b5 <= a5 : boolean +>b5 : new (x: string, y: number) => string +>a5 : new (x: T, y: T) => T + +var r3b6 = b6 <= a6; +>r3b6 : boolean +>b6 <= a6 : boolean +>b6 : new (x: Base, y: C) => Base +>a6 : new (x: T, y: U) => T + +// operator >= +var r4a1 = a1 >= b1; +>r4a1 : boolean +>a1 >= b1 : boolean +>a1 : new (x: T) => T +>b1 : new () => string + +var r4a2 = a2 >= b2; +>r4a2 : boolean +>a2 >= b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string) => number + +var r4a3 = a3 >= b3; +>r4a3 : boolean +>a3 >= b3 : boolean +>a3 : new (x?: T) => T +>b3 : new (x?: string) => number + +var r4a4 = a4 >= b4; +>r4a4 : boolean +>a4 >= b4 : boolean +>a4 : new (...x: T[]) => T +>b4 : new (...x: string[]) => number + +var r4a5 = a5 >= b5; +>r4a5 : boolean +>a5 >= b5 : boolean +>a5 : new (x: T, y: T) => T +>b5 : new (x: string, y: number) => string + +var r4a6 = a6 >= b6; +>r4a6 : boolean +>a6 >= b6 : boolean +>a6 : new (x: T, y: U) => T +>b6 : new (x: Base, y: C) => Base + +var r4b1 = b1 >= a1; +>r4b1 : boolean +>b1 >= a1 : boolean +>b1 : new () => string +>a1 : new (x: T) => T + +var r4b2 = b2 >= a2; +>r4b2 : boolean +>b2 >= a2 : boolean +>b2 : new (x: string) => number +>a2 : new (x: T) => T + +var r4b3 = b3 >= a3; +>r4b3 : boolean +>b3 >= a3 : boolean +>b3 : new (x?: string) => number +>a3 : new (x?: T) => T + +var r4b4 = b4 >= a4; +>r4b4 : boolean +>b4 >= a4 : boolean +>b4 : new (...x: string[]) => number +>a4 : new (...x: T[]) => T + +var r4b5 = b5 >= a5; +>r4b5 : boolean +>b5 >= a5 : boolean +>b5 : new (x: string, y: number) => string +>a5 : new (x: T, y: T) => T + +var r4b6 = b6 >= a6; +>r4b6 : boolean +>b6 >= a6 : boolean +>b6 : new (x: Base, y: C) => Base +>a6 : new (x: T, y: U) => T + +// operator == +var r5a1 = a1 == b1; +>r5a1 : boolean +>a1 == b1 : boolean +>a1 : new (x: T) => T +>b1 : new () => string + +var r5a2 = a2 == b2; +>r5a2 : boolean +>a2 == b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string) => number + +var r5a3 = a3 == b3; +>r5a3 : boolean +>a3 == b3 : boolean +>a3 : new (x?: T) => T +>b3 : new (x?: string) => number + +var r5a4 = a4 == b4; +>r5a4 : boolean +>a4 == b4 : boolean +>a4 : new (...x: T[]) => T +>b4 : new (...x: string[]) => number + +var r5a5 = a5 == b5; +>r5a5 : boolean +>a5 == b5 : boolean +>a5 : new (x: T, y: T) => T +>b5 : new (x: string, y: number) => string + +var r5a6 = a6 == b6; +>r5a6 : boolean +>a6 == b6 : boolean +>a6 : new (x: T, y: U) => T +>b6 : new (x: Base, y: C) => Base + +var r5b1 = b1 == a1; +>r5b1 : boolean +>b1 == a1 : boolean +>b1 : new () => string +>a1 : new (x: T) => T + +var r5b2 = b2 == a2; +>r5b2 : boolean +>b2 == a2 : boolean +>b2 : new (x: string) => number +>a2 : new (x: T) => T + +var r5b3 = b3 == a3; +>r5b3 : boolean +>b3 == a3 : boolean +>b3 : new (x?: string) => number +>a3 : new (x?: T) => T + +var r5b4 = b4 == a4; +>r5b4 : boolean +>b4 == a4 : boolean +>b4 : new (...x: string[]) => number +>a4 : new (...x: T[]) => T + +var r5b5 = b5 == a5; +>r5b5 : boolean +>b5 == a5 : boolean +>b5 : new (x: string, y: number) => string +>a5 : new (x: T, y: T) => T + +var r5b6 = b6 == a6; +>r5b6 : boolean +>b6 == a6 : boolean +>b6 : new (x: Base, y: C) => Base +>a6 : new (x: T, y: U) => T + +// operator != +var r6a1 = a1 != b1; +>r6a1 : boolean +>a1 != b1 : boolean +>a1 : new (x: T) => T +>b1 : new () => string + +var r6a2 = a2 != b2; +>r6a2 : boolean +>a2 != b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string) => number + +var r6a3 = a3 != b3; +>r6a3 : boolean +>a3 != b3 : boolean +>a3 : new (x?: T) => T +>b3 : new (x?: string) => number + +var r6a4 = a4 != b4; +>r6a4 : boolean +>a4 != b4 : boolean +>a4 : new (...x: T[]) => T +>b4 : new (...x: string[]) => number + +var r6a5 = a5 != b5; +>r6a5 : boolean +>a5 != b5 : boolean +>a5 : new (x: T, y: T) => T +>b5 : new (x: string, y: number) => string + +var r6a6 = a6 != b6; +>r6a6 : boolean +>a6 != b6 : boolean +>a6 : new (x: T, y: U) => T +>b6 : new (x: Base, y: C) => Base + +var r6b1 = b1 != a1; +>r6b1 : boolean +>b1 != a1 : boolean +>b1 : new () => string +>a1 : new (x: T) => T + +var r6b2 = b2 != a2; +>r6b2 : boolean +>b2 != a2 : boolean +>b2 : new (x: string) => number +>a2 : new (x: T) => T + +var r6b3 = b3 != a3; +>r6b3 : boolean +>b3 != a3 : boolean +>b3 : new (x?: string) => number +>a3 : new (x?: T) => T + +var r6b4 = b4 != a4; +>r6b4 : boolean +>b4 != a4 : boolean +>b4 : new (...x: string[]) => number +>a4 : new (...x: T[]) => T + +var r6b5 = b5 != a5; +>r6b5 : boolean +>b5 != a5 : boolean +>b5 : new (x: string, y: number) => string +>a5 : new (x: T, y: T) => T + +var r6b6 = b6 != a6; +>r6b6 : boolean +>b6 != a6 : boolean +>b6 : new (x: Base, y: C) => Base +>a6 : new (x: T, y: U) => T + +// operator === +var r7a1 = a1 === b1; +>r7a1 : boolean +>a1 === b1 : boolean +>a1 : new (x: T) => T +>b1 : new () => string + +var r7a2 = a2 === b2; +>r7a2 : boolean +>a2 === b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string) => number + +var r7a3 = a3 === b3; +>r7a3 : boolean +>a3 === b3 : boolean +>a3 : new (x?: T) => T +>b3 : new (x?: string) => number + +var r7a4 = a4 === b4; +>r7a4 : boolean +>a4 === b4 : boolean +>a4 : new (...x: T[]) => T +>b4 : new (...x: string[]) => number + +var r7a5 = a5 === b5; +>r7a5 : boolean +>a5 === b5 : boolean +>a5 : new (x: T, y: T) => T +>b5 : new (x: string, y: number) => string + +var r7a6 = a6 === b6; +>r7a6 : boolean +>a6 === b6 : boolean +>a6 : new (x: T, y: U) => T +>b6 : new (x: Base, y: C) => Base + +var r7b1 = b1 === a1; +>r7b1 : boolean +>b1 === a1 : boolean +>b1 : new () => string +>a1 : new (x: T) => T + +var r7b2 = b2 === a2; +>r7b2 : boolean +>b2 === a2 : boolean +>b2 : new (x: string) => number +>a2 : new (x: T) => T + +var r7b3 = b3 === a3; +>r7b3 : boolean +>b3 === a3 : boolean +>b3 : new (x?: string) => number +>a3 : new (x?: T) => T + +var r7b4 = b4 === a4; +>r7b4 : boolean +>b4 === a4 : boolean +>b4 : new (...x: string[]) => number +>a4 : new (...x: T[]) => T + +var r7b5 = b5 === a5; +>r7b5 : boolean +>b5 === a5 : boolean +>b5 : new (x: string, y: number) => string +>a5 : new (x: T, y: T) => T + +var r7b6 = b6 === a6; +>r7b6 : boolean +>b6 === a6 : boolean +>b6 : new (x: Base, y: C) => Base +>a6 : new (x: T, y: U) => T + +// operator !== +var r8a1 = a1 !== b1; +>r8a1 : boolean +>a1 !== b1 : boolean +>a1 : new (x: T) => T +>b1 : new () => string + +var r8a2 = a2 !== b2; +>r8a2 : boolean +>a2 !== b2 : boolean +>a2 : new (x: T) => T +>b2 : new (x: string) => number + +var r8a3 = a3 !== b3; +>r8a3 : boolean +>a3 !== b3 : boolean +>a3 : new (x?: T) => T +>b3 : new (x?: string) => number + +var r8a4 = a4 !== b4; +>r8a4 : boolean +>a4 !== b4 : boolean +>a4 : new (...x: T[]) => T +>b4 : new (...x: string[]) => number + +var r8a5 = a5 !== b5; +>r8a5 : boolean +>a5 !== b5 : boolean +>a5 : new (x: T, y: T) => T +>b5 : new (x: string, y: number) => string + +var r8a6 = a6 !== b6; +>r8a6 : boolean +>a6 !== b6 : boolean +>a6 : new (x: T, y: U) => T +>b6 : new (x: Base, y: C) => Base + +var r8b1 = b1 !== a1; +>r8b1 : boolean +>b1 !== a1 : boolean +>b1 : new () => string +>a1 : new (x: T) => T + +var r8b2 = b2 !== a2; +>r8b2 : boolean +>b2 !== a2 : boolean +>b2 : new (x: string) => number +>a2 : new (x: T) => T + +var r8b3 = b3 !== a3; +>r8b3 : boolean +>b3 !== a3 : boolean +>b3 : new (x?: string) => number +>a3 : new (x?: T) => T + +var r8b4 = b4 !== a4; +>r8b4 : boolean +>b4 !== a4 : boolean +>b4 : new (...x: string[]) => number +>a4 : new (...x: T[]) => T + +var r8b5 = b5 !== a5; +>r8b5 : boolean +>b5 !== a5 : boolean +>b5 : new (x: string, y: number) => string +>a5 : new (x: T, y: T) => T + +var r8b6 = b6 !== a6; +>r8b6 : boolean +>b6 !== a6 : boolean +>b6 : new (x: Base, y: C) => Base +>a6 : new (x: T, y: U) => T + diff --git a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt deleted file mode 100644 index 15293f3953a02..0000000000000 --- a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.errors.txt +++ /dev/null @@ -1,45 +0,0 @@ -tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(5,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(8,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(10,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(13,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(21,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts(21,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts (6 errors) ==== - // used to be valid, now an error to do this - - interface IComparable { - } - function f>() { - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - interface I1> { // Error, any does not satisfy the constraint I1 - ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - interface I2 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - interface I4 T> { - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - // No error - interface I3 { - method1(); - } - - function foo(v: V) => void>() { - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - \ No newline at end of file diff --git a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.symbols b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.symbols new file mode 100644 index 0000000000000..ec987116a43f1 --- /dev/null +++ b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts === +// used to be valid, now an error to do this + +interface IComparable { +>IComparable : Symbol(IComparable, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 0, 0)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 2, 22)) +} +function f>() { +>f : Symbol(f, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 3, 1)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 4, 11)) +>I : Symbol(I, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 4, 13)) +>IComparable : Symbol(IComparable, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 0, 0)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 4, 11)) +} + +interface I1> { // Error, any does not satisfy the constraint I1 +>I1 : Symbol(I1, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 5, 1)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 7, 13)) +>U : Symbol(U, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 7, 15)) +>I1 : Symbol(I1, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 5, 1)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 7, 13)) +} +interface I2 { +>I2 : Symbol(I2, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 8, 1)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 9, 13)) +>U : Symbol(U, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 9, 15)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 9, 13)) +} + +interface I4 T> { +>I4 : Symbol(I4, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 10, 1)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 12, 13)) +>U : Symbol(U, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 12, 15)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 12, 13)) +} + +// No error +interface I3 { +>I3 : Symbol(I3, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 13, 1)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 16, 13)) +>U : Symbol(U, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 16, 15)) + + method1(); +>method1 : Symbol(method1, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 16, 35)) +>X : Symbol(X, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 17, 12)) +>Y : Symbol(Y, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 17, 14)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 16, 13)) +} + +function foo(v: V) => void>() { +>foo : Symbol(foo, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 18, 1)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 20, 13)) +>U : Symbol(U, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 20, 15)) +>V : Symbol(V, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 20, 27)) +>T : Symbol(T, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 20, 13)) +>v : Symbol(v, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 20, 40)) +>V : Symbol(V, Decl(constraintReferencingTypeParameterFromSameTypeParameterList.ts, 20, 27)) +} + + diff --git a/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.types b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.types new file mode 100644 index 0000000000000..f130348628356 --- /dev/null +++ b/tests/baselines/reference/constraintReferencingTypeParameterFromSameTypeParameterList.types @@ -0,0 +1,60 @@ +=== tests/cases/compiler/constraintReferencingTypeParameterFromSameTypeParameterList.ts === +// used to be valid, now an error to do this + +interface IComparable { +>IComparable : IComparable +>T : T +} +function f>() { +>f : >() => void +>T : T +>I : I +>IComparable : IComparable +>T : T +} + +interface I1> { // Error, any does not satisfy the constraint I1 +>I1 : I1 +>T : T +>U : U +>I1 : I1 +>T : T +} +interface I2 { +>I2 : I2 +>T : T +>U : U +>T : T +} + +interface I4 T> { +>I4 : I4 +>T : T +>U : U +>T : T +} + +// No error +interface I3 { +>I3 : I3 +>T : T +>U : U + + method1(); +>method1 : () => any +>X : X +>Y : Y +>T : T +} + +function foo(v: V) => void>() { +>foo : (v: V) => void>() => void +>T : T +>U : U +>V : V +>T : T +>v : V +>V : V +} + + diff --git a/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt b/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt deleted file mode 100644 index b297d2be970fc..0000000000000 --- a/tests/baselines/reference/constraintSatisfactionWithAny2.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny2.ts(4,25): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny2.ts (1 errors) ==== - // errors expected for type parameter cannot be referenced in the constraints of the same list - // any is not a valid type argument unless there is no constraint, or the constraint is any - - declare function foo(x: U) => Z>(y: T): Z; - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var a: any; - - foo(a); - foo(a); \ No newline at end of file diff --git a/tests/baselines/reference/constraintSatisfactionWithAny2.symbols b/tests/baselines/reference/constraintSatisfactionWithAny2.symbols new file mode 100644 index 0000000000000..25d389c5c4adf --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithAny2.symbols @@ -0,0 +1,27 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny2.ts === +// errors expected for type parameter cannot be referenced in the constraints of the same list +// any is not a valid type argument unless there is no constraint, or the constraint is any + +declare function foo(x: U) => Z>(y: T): Z; +>foo : Symbol(foo, Decl(constraintSatisfactionWithAny2.ts, 0, 0)) +>Z : Symbol(Z, Decl(constraintSatisfactionWithAny2.ts, 3, 21)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny2.ts, 3, 23)) +>U : Symbol(U, Decl(constraintSatisfactionWithAny2.ts, 3, 35)) +>x : Symbol(x, Decl(constraintSatisfactionWithAny2.ts, 3, 38)) +>U : Symbol(U, Decl(constraintSatisfactionWithAny2.ts, 3, 35)) +>Z : Symbol(Z, Decl(constraintSatisfactionWithAny2.ts, 3, 21)) +>y : Symbol(y, Decl(constraintSatisfactionWithAny2.ts, 3, 50)) +>T : Symbol(T, Decl(constraintSatisfactionWithAny2.ts, 3, 23)) +>Z : Symbol(Z, Decl(constraintSatisfactionWithAny2.ts, 3, 21)) + +var a: any; +>a : Symbol(a, Decl(constraintSatisfactionWithAny2.ts, 4, 3)) + +foo(a); +>foo : Symbol(foo, Decl(constraintSatisfactionWithAny2.ts, 0, 0)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny2.ts, 4, 3)) + +foo(a); +>foo : Symbol(foo, Decl(constraintSatisfactionWithAny2.ts, 0, 0)) +>a : Symbol(a, Decl(constraintSatisfactionWithAny2.ts, 4, 3)) + diff --git a/tests/baselines/reference/constraintSatisfactionWithAny2.types b/tests/baselines/reference/constraintSatisfactionWithAny2.types new file mode 100644 index 0000000000000..e40e00c5161b8 --- /dev/null +++ b/tests/baselines/reference/constraintSatisfactionWithAny2.types @@ -0,0 +1,29 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/constraintSatisfactionWithAny2.ts === +// errors expected for type parameter cannot be referenced in the constraints of the same list +// any is not a valid type argument unless there is no constraint, or the constraint is any + +declare function foo(x: U) => Z>(y: T): Z; +>foo : (x: U) => Z>(y: T) => Z +>Z : Z +>T : T +>U : U +>x : U +>U : U +>Z : Z +>y : T +>T : T +>Z : Z + +var a: any; +>a : any + +foo(a); +>foo(a) : {} +>foo : (x: U) => Z>(y: T) => Z +>a : any + +foo(a); +>foo(a) : any +>foo : (x: U) => Z>(y: T) => Z +>a : any + diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt deleted file mode 100644 index b7375989e6bcd..0000000000000 --- a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.errors.txt +++ /dev/null @@ -1,18 +0,0 @@ -tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts(3,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts(4,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts (2 errors) ==== - interface Object { } - - class Foo { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - class Bar { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - data: Foo; // Error 1 Type 'Object' does not satisfy the constraint 'T' for type parameter 'U extends T'. - } - - var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type - \ No newline at end of file diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.symbols b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.symbols new file mode 100644 index 0000000000000..fa754b23dea4e --- /dev/null +++ b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts === +interface Object { } +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 0)) + +class Foo { } +>Foo : Symbol(Foo, Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 20)) +>T : Symbol(T, Decl(constraintsThatReferenceOtherContstraints1.ts, 2, 10)) +>U : Symbol(U, Decl(constraintsThatReferenceOtherContstraints1.ts, 2, 12)) +>T : Symbol(T, Decl(constraintsThatReferenceOtherContstraints1.ts, 2, 10)) + +class Bar { +>Bar : Symbol(Bar, Decl(constraintsThatReferenceOtherContstraints1.ts, 2, 29)) +>T : Symbol(T, Decl(constraintsThatReferenceOtherContstraints1.ts, 3, 10)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 0)) +>U : Symbol(U, Decl(constraintsThatReferenceOtherContstraints1.ts, 3, 27)) +>T : Symbol(T, Decl(constraintsThatReferenceOtherContstraints1.ts, 3, 10)) + + data: Foo; // Error 1 Type 'Object' does not satisfy the constraint 'T' for type parameter 'U extends T'. +>data : Symbol(data, Decl(constraintsThatReferenceOtherContstraints1.ts, 3, 42)) +>Foo : Symbol(Foo, Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 20)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 0)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 0)) +} + +var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type +>x : Symbol(x, Decl(constraintsThatReferenceOtherContstraints1.ts, 7, 3)) +>Foo : Symbol(Foo, Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 20)) +>a : Symbol(a, Decl(constraintsThatReferenceOtherContstraints1.ts, 7, 13)) +>a : Symbol(a, Decl(constraintsThatReferenceOtherContstraints1.ts, 7, 28)) +>b : Symbol(b, Decl(constraintsThatReferenceOtherContstraints1.ts, 7, 39)) + diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.types b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.types new file mode 100644 index 0000000000000..e3cd5dc51bc8d --- /dev/null +++ b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts === +interface Object { } +>Object : Object + +class Foo { } +>Foo : Foo +>T : T +>U : U +>T : T + +class Bar { +>Bar : Bar +>T : T +>Object : Object +>U : U +>T : T + + data: Foo; // Error 1 Type 'Object' does not satisfy the constraint 'T' for type parameter 'U extends T'. +>data : Foo +>Foo : Foo +>Object : Object +>Object : Object +} + +var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type +>x : Foo<{ a: string; }, { a: string; b: number; }> +>Foo : Foo +>a : string +>a : string +>b : number + diff --git a/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt b/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt deleted file mode 100644 index ca7385b9c290a..0000000000000 --- a/tests/baselines/reference/contextuallyTypingOrOperator3.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -tests/cases/compiler/contextuallyTypingOrOperator3.ts(1,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/contextuallyTypingOrOperator3.ts (1 errors) ==== - function foo(u: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var x3: U = u || u; - } \ No newline at end of file diff --git a/tests/baselines/reference/contextuallyTypingOrOperator3.symbols b/tests/baselines/reference/contextuallyTypingOrOperator3.symbols new file mode 100644 index 0000000000000..2f8ffb6234ce5 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator3.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/contextuallyTypingOrOperator3.ts === +function foo(u: U) { +>foo : Symbol(foo, Decl(contextuallyTypingOrOperator3.ts, 0, 0)) +>T : Symbol(T, Decl(contextuallyTypingOrOperator3.ts, 0, 13)) +>U : Symbol(U, Decl(contextuallyTypingOrOperator3.ts, 0, 15)) +>T : Symbol(T, Decl(contextuallyTypingOrOperator3.ts, 0, 13)) +>u : Symbol(u, Decl(contextuallyTypingOrOperator3.ts, 0, 29)) +>U : Symbol(U, Decl(contextuallyTypingOrOperator3.ts, 0, 15)) + + var x3: U = u || u; +>x3 : Symbol(x3, Decl(contextuallyTypingOrOperator3.ts, 1, 7)) +>U : Symbol(U, Decl(contextuallyTypingOrOperator3.ts, 0, 15)) +>u : Symbol(u, Decl(contextuallyTypingOrOperator3.ts, 0, 29)) +>u : Symbol(u, Decl(contextuallyTypingOrOperator3.ts, 0, 29)) +} diff --git a/tests/baselines/reference/contextuallyTypingOrOperator3.types b/tests/baselines/reference/contextuallyTypingOrOperator3.types new file mode 100644 index 0000000000000..f6ccbbf9ab1c5 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypingOrOperator3.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/contextuallyTypingOrOperator3.ts === +function foo(u: U) { +>foo : (u: U) => void +>T : T +>U : U +>T : T +>u : U +>U : U + + var x3: U = u || u; +>x3 : U +>U : U +>u || u : U +>u : U +>u : U +} diff --git a/tests/baselines/reference/declarationEmitFBoundedTypeParams.js b/tests/baselines/reference/declarationEmitFBoundedTypeParams.js new file mode 100644 index 0000000000000..407dbf395e577 --- /dev/null +++ b/tests/baselines/reference/declarationEmitFBoundedTypeParams.js @@ -0,0 +1,20 @@ +//// [declarationEmitFBoundedTypeParams.ts] + +// Repro from #6040 + +function append(result: a[], value: b): a[] { + result.push(value); + return result; +} + + +//// [declarationEmitFBoundedTypeParams.js] +// Repro from #6040 +function append(result, value) { + result.push(value); + return result; +} + + +//// [declarationEmitFBoundedTypeParams.d.ts] +declare function append(result: a[], value: b): a[]; diff --git a/tests/baselines/reference/declarationEmitFBoundedTypeParams.symbols b/tests/baselines/reference/declarationEmitFBoundedTypeParams.symbols new file mode 100644 index 0000000000000..bb12ea8960025 --- /dev/null +++ b/tests/baselines/reference/declarationEmitFBoundedTypeParams.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/declarationEmitFBoundedTypeParams.ts === + +// Repro from #6040 + +function append(result: a[], value: b): a[] { +>append : Symbol(append, Decl(declarationEmitFBoundedTypeParams.ts, 0, 0)) +>a : Symbol(a, Decl(declarationEmitFBoundedTypeParams.ts, 3, 16)) +>b : Symbol(b, Decl(declarationEmitFBoundedTypeParams.ts, 3, 18)) +>a : Symbol(a, Decl(declarationEmitFBoundedTypeParams.ts, 3, 16)) +>result : Symbol(result, Decl(declarationEmitFBoundedTypeParams.ts, 3, 32)) +>a : Symbol(a, Decl(declarationEmitFBoundedTypeParams.ts, 3, 16)) +>value : Symbol(value, Decl(declarationEmitFBoundedTypeParams.ts, 3, 44)) +>b : Symbol(b, Decl(declarationEmitFBoundedTypeParams.ts, 3, 18)) +>a : Symbol(a, Decl(declarationEmitFBoundedTypeParams.ts, 3, 16)) + + result.push(value); +>result.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>result : Symbol(result, Decl(declarationEmitFBoundedTypeParams.ts, 3, 32)) +>push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>value : Symbol(value, Decl(declarationEmitFBoundedTypeParams.ts, 3, 44)) + + return result; +>result : Symbol(result, Decl(declarationEmitFBoundedTypeParams.ts, 3, 32)) +} + diff --git a/tests/baselines/reference/declarationEmitFBoundedTypeParams.types b/tests/baselines/reference/declarationEmitFBoundedTypeParams.types new file mode 100644 index 0000000000000..7f7198b3b6d5c --- /dev/null +++ b/tests/baselines/reference/declarationEmitFBoundedTypeParams.types @@ -0,0 +1,26 @@ +=== tests/cases/compiler/declarationEmitFBoundedTypeParams.ts === + +// Repro from #6040 + +function append(result: a[], value: b): a[] { +>append : (result: a[], value: b) => a[] +>a : a +>b : b +>a : a +>result : a[] +>a : a +>value : b +>b : b +>a : a + + result.push(value); +>result.push(value) : number +>result.push : (...items: a[]) => number +>result : a[] +>push : (...items: a[]) => number +>value : b + + return result; +>result : a[] +} + diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt index 4a060ac34566e..1316727076f37 100644 --- a/tests/baselines/reference/enumAssignability.errors.txt +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -20,7 +20,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2322: Type 'E' is not assignable to type '(x: T) => T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String'. Property 'charAt' is missing in type 'Number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(47,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2322: Type 'E' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(49,9): error TS2322: Type 'E' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(50,9): error TS2322: Type 'E' is not assignable to type 'V'. @@ -28,7 +27,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(52,13): error TS2322: Type 'E' is not assignable to type 'B'. -==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts (21 errors) ==== +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts (20 errors) ==== // enums assignable to number, any, Object, errors unless otherwise noted enum E { A } @@ -113,8 +112,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi !!! error TS2322: Property 'charAt' is missing in type 'Number'. function foo(x: T, y: U, z: V) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x = e; ~ !!! error TS2322: Type 'E' is not assignable to type 'T'. diff --git a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt index e5c341b34df08..1f8def801cccb 100644 --- a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt +++ b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.errors.txt @@ -13,11 +13,10 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotA tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(95,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'typeof f'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(105,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'typeof c'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(111,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(115,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts(117,5): error TS2411: Property 'foo' of type 'E' is not assignable to string index type 'U'. -==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts (17 errors) ==== +==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotASubtypeOfAnythingButNumber.ts (16 errors) ==== // enums are only subtypes of number, any and no other types enum E { A } @@ -163,8 +162,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/enumIsNotA interface I18 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: E; ~~~~~~~ diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 4f78636d08cf1..7b3aa92828da4 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -18,13 +18,14 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain Type 'new (x: T) => T' provides no match for the signature '(x: string): string' tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(34,16): error TS2345: Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'. Type 'F2' provides no match for the signature '(x: string): string' -tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(36,38): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(37,10): error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. Type '() => void' is not assignable to type '(x: string) => string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(38,10): error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. + Type 'T' is not assignable to type '(x: string) => string'. + Type '() => void' is not assignable to type '(x: string) => string'. -==== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts (14 errors) ==== +==== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts (13 errors) ==== // satisfaction of a constraint to Function, all of these invocations are errors unless otherwise noted function foo(x: T): T { return x; } @@ -92,8 +93,6 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain !!! error TS2345: Type 'F2' provides no match for the signature '(x: string): string' function fff(x: T, y: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo2(x); ~ !!! error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. @@ -101,5 +100,7 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain foo2(y); ~ !!! error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. +!!! error TS2345: Type 'T' is not assignable to type '(x: string) => string'. +!!! error TS2345: Type '() => void' is not assignable to type '(x: string) => string'. } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt index a981d337093ea..cc10d4c782c67 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt +++ b/tests/baselines/reference/functionWithMultipleReturnStatements.errors.txt @@ -4,12 +4,9 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(32,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(44,10): error TS2354: No best common type exists among return expressions. tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(49,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(57,10): error TS2354: No best common type exists among return expressions. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(57,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts(57,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (9 errors) ==== +==== tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMultipleReturnStatements.ts (6 errors) ==== // return type of a function with multiple returns is the BCT of each return statement // it is an error if there is no single BCT, these are error cases @@ -79,12 +76,6 @@ tests/cases/conformance/types/typeRelationships/bestCommonType/functionWithMulti } function f8(x: T, y: U) { - ~~ -!!! error TS2354: No best common type exists among return expressions. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. if (true) { return x; } else { diff --git a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt deleted file mode 100644 index 2ff3441359524..0000000000000 --- a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/compiler/genericAssignmentCompatOfFunctionSignatures1.ts(1,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/genericAssignmentCompatOfFunctionSignatures1.ts(2,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/genericAssignmentCompatOfFunctionSignatures1.ts (2 errors) ==== - var x1 = function foo3(x: T, z: U) { } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var x2 = function foo3(x: T, z: U) { } - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - x1 = x2; - x2 = x1; \ No newline at end of file diff --git a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.symbols b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.symbols new file mode 100644 index 0000000000000..1dfb699d3b48f --- /dev/null +++ b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/genericAssignmentCompatOfFunctionSignatures1.ts === +var x1 = function foo3(x: T, z: U) { } +>x1 : Symbol(x1, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 3)) +>foo3 : Symbol(foo3, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 8)) +>T : Symbol(T, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 23)) +>U : Symbol(U, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 25)) +>a : Symbol(a, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 37)) +>T : Symbol(T, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 23)) +>b : Symbol(b, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 43)) +>x : Symbol(x, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 57)) +>T : Symbol(T, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 23)) +>z : Symbol(z, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 62)) +>U : Symbol(U, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 25)) + +var x2 = function foo3(x: T, z: U) { } +>x2 : Symbol(x2, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 3)) +>foo3 : Symbol(foo3, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 8)) +>T : Symbol(T, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 23)) +>U : Symbol(U, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 25)) +>a : Symbol(a, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 37)) +>T : Symbol(T, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 23)) +>b : Symbol(b, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 43)) +>x : Symbol(x, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 57)) +>T : Symbol(T, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 23)) +>z : Symbol(z, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 62)) +>U : Symbol(U, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 25)) + +x1 = x2; +>x1 : Symbol(x1, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 3)) +>x2 : Symbol(x2, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 3)) + +x2 = x1; +>x2 : Symbol(x2, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 1, 3)) +>x1 : Symbol(x1, Decl(genericAssignmentCompatOfFunctionSignatures1.ts, 0, 3)) + diff --git a/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.types b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.types new file mode 100644 index 0000000000000..c5765a5adf4fc --- /dev/null +++ b/tests/baselines/reference/genericAssignmentCompatOfFunctionSignatures1.types @@ -0,0 +1,39 @@ +=== tests/cases/compiler/genericAssignmentCompatOfFunctionSignatures1.ts === +var x1 = function foo3(x: T, z: U) { } +>x1 : (x: T, z: U) => void +>function foo3(x: T, z: U) { } : (x: T, z: U) => void +>foo3 : (x: T, z: U) => void +>T : T +>U : U +>a : T +>T : T +>b : string +>x : T +>T : T +>z : U +>U : U + +var x2 = function foo3(x: T, z: U) { } +>x2 : (x: T, z: U) => void +>function foo3(x: T, z: U) { } : (x: T, z: U) => void +>foo3 : (x: T, z: U) => void +>T : T +>U : U +>a : T +>T : T +>b : number +>x : T +>T : T +>z : U +>U : U + +x1 = x2; +>x1 = x2 : (x: T, z: U) => void +>x1 : (x: T, z: U) => void +>x2 : (x: T, z: U) => void + +x2 = x1; +>x2 = x1 : (x: T, z: U) => void +>x2 : (x: T, z: U) => void +>x1 : (x: T, z: U) => void + diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt index d8228dd22431f..6ac3c9e670373 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt @@ -1,14 +1,11 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts(3,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts(11,26): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Date'. Property 'toDateString' is missing in type 'Number'. -==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts (2 errors) ==== +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts (1 errors) ==== // Generic call with parameters of T and U, U extends T, no parameter of type U function foo(t: T) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var u: U; return u; } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt index 54455782cc2fc..6c2be7b10d13c 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.errors.txt @@ -1,10 +1,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(18,10): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'Derived' is not a valid type argument because it is not a supertype of candidate 'Derived2'. Property 'y' is missing in type 'Derived2'. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(20,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts (2 errors) ==== +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts (1 errors) ==== // Generic call with constraints infering type parameter from object member properties class Base { @@ -29,8 +28,6 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj !!! error TS2453: Property 'y' is missing in type 'Derived2'. function f2(a: U) { - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var r: T; return r; } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt index 5f416bb859605..c5c6cbe05c61c 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts(12,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts(28,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts(19,17): error TS2345: Argument of type 'C' is not assignable to parameter of type 'D'. + Property 'y' is missing in type 'C'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts(30,24): error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'. -==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts (3 errors) ==== +==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints4.ts (2 errors) ==== // Generic call with constraints infering type parameter from object member properties class C { @@ -16,8 +16,6 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj } function foo(t: T, t2: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return (x: T) => t2; } @@ -25,6 +23,9 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj var d: D; var r = foo(c, d); var r2 = foo(d, c); // error because C does not extend D + ~ +!!! error TS2345: Argument of type 'C' is not assignable to parameter of type 'D'. +!!! error TS2345: Property 'y' is missing in type 'C'. var r3 = foo(c, { x: '', foo: c }); var r4 = foo(null, null); var r5 = foo({}, null); @@ -34,8 +35,6 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj var r9 = foo(() => { }, () => 1); function other() { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var r4 = foo(c, d); var r5 = foo(c, d); // error ~ diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt index 887abfaff63fe..2632e867edfde 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.errors.txt @@ -1,5 +1,7 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(12,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(21,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(18,17): error TS2345: Argument of type 'C' is not assignable to parameter of type 'D'. + Property 'y' is missing in type 'C'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(19,23): error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. + Type 'void' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints5.ts(22,24): error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'. @@ -16,19 +18,21 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj } function foo(t: T, t2: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return (x: T) => t2; } var c: C; var d: D; var r2 = foo(d, c); // the constraints are self-referencing, no downstream error + ~ +!!! error TS2345: Argument of type 'C' is not assignable to parameter of type 'D'. +!!! error TS2345: Property 'y' is missing in type 'C'. var r9 = foo(() => 1, () => { }); // the constraints are self-referencing, no downstream error + ~~~~~~~~~ +!!! error TS2345: Argument of type '() => void' is not assignable to parameter of type '() => number'. +!!! error TS2345: Type 'void' is not assignable to type 'number'. function other() { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var r5 = foo(c, d); // error ~ !!! error TS2345: Argument of type 'C' is not assignable to parameter of type 'T'. diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt deleted file mode 100644 index b0c0bee94fd3c..0000000000000 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.errors.txt +++ /dev/null @@ -1,33 +0,0 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(15,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts(23,9): error TS2322: Type 'T' is not assignable to type 'U'. - - -==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts (2 errors) ==== - // Type inference infers from indexers in target type, error cases - - function foo(x: T) { - return x; - } - - function other(arg: T) { - var b: { - [x: string]: Object; - [x: number]: T; // ok, T is a subtype of Object because its apparent type is {} - }; - var r2 = foo(b); // T - } - - function other3(arg: T) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var b: { - [x: string]: Object; - [x: number]: T; - }; - var r2 = foo(b); - var d = r2[1]; - var e = r2['1']; - var u: U = r2[1]; // ok - ~ -!!! error TS2322: Type 'T' is not assignable to type 'U'. - } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.symbols new file mode 100644 index 0000000000000..0f3fe58da018d --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.symbols @@ -0,0 +1,76 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts === +// Type inference infers from indexers in target type, error cases + +function foo(x: T) { +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 0, 0)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 2, 13)) +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 2, 16)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 2, 13)) + + return x; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 2, 16)) +} + +function other(arg: T) { +>other : Symbol(other, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 4, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 6, 15)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 6, 18)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 6, 15)) + + var b: { +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 7, 7)) + + [x: string]: Object; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 8, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + [x: number]: T; // ok, T is a subtype of Object because its apparent type is {} +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 9, 9)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 6, 15)) + + }; + var r2 = foo(b); // T +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 11, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 7, 7)) +} + +function other3(arg: T) { +>other3 : Symbol(other3, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 12, 1)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 16)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 28)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 28)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 45)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 16)) + + var b: { +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 15, 7)) + + [x: string]: Object; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 16, 9)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + [x: number]: T; +>x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 17, 9)) +>T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 16)) + + }; + var r2 = foo(b); +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 19, 7)) +>foo : Symbol(foo, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 0, 0)) +>b : Symbol(b, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 15, 7)) + + var d = r2[1]; +>d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 20, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 19, 7)) + + var e = r2['1']; +>e : Symbol(e, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 21, 7)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 19, 7)) + + var u: U = r2[1]; // ok +>u : Symbol(u, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 22, 7)) +>U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 28)) +>r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 19, 7)) +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types new file mode 100644 index 0000000000000..bde72409edcd6 --- /dev/null +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.types @@ -0,0 +1,84 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndIndexersErrors.ts === +// Type inference infers from indexers in target type, error cases + +function foo(x: T) { +>foo : (x: T) => T +>T : T +>x : T +>T : T + + return x; +>x : T +} + +function other(arg: T) { +>other : (arg: T) => void +>T : T +>arg : T +>T : T + + var b: { +>b : { [x: string]: Object; [x: number]: T; } + + [x: string]: Object; +>x : string +>Object : Object + + [x: number]: T; // ok, T is a subtype of Object because its apparent type is {} +>x : number +>T : T + + }; + var r2 = foo(b); // T +>r2 : { [x: string]: Object; [x: number]: T; } +>foo(b) : { [x: string]: Object; [x: number]: T; } +>foo : (x: T) => T +>b : { [x: string]: Object; [x: number]: T; } +} + +function other3(arg: T) { +>other3 : (arg: T) => void +>T : T +>U : U +>U : U +>Date : Date +>arg : T +>T : T + + var b: { +>b : { [x: string]: Object; [x: number]: T; } + + [x: string]: Object; +>x : string +>Object : Object + + [x: number]: T; +>x : number +>T : T + + }; + var r2 = foo(b); +>r2 : { [x: string]: Object; [x: number]: T; } +>foo(b) : { [x: string]: Object; [x: number]: T; } +>foo : (x: T) => T +>b : { [x: string]: Object; [x: number]: T; } + + var d = r2[1]; +>d : T +>r2[1] : T +>r2 : { [x: string]: Object; [x: number]: T; } +>1 : number + + var e = r2['1']; +>e : Object +>r2['1'] : Object +>r2 : { [x: string]: Object; [x: number]: T; } +>'1' : string + + var u: U = r2[1]; // ok +>u : U +>U : U +>r2[1] : T +>r2 : { [x: string]: Object; [x: number]: T; } +>1 : number +} diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt index e9fae4503776f..9795248e2f7f0 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.errors.txt @@ -1,17 +1,10 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(5,33): error TS2322: Type 'number' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(6,37): error TS2322: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(7,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(7,37): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(8,56): error TS2322: Type 'U' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts(9,50): error TS2322: Type 'V' is not assignable to type 'U'. + Type 'T' is not assignable to type 'V'. -==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts (11 errors) ==== +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericCallWithObjectTypeArgsAndInitializers.ts (3 errors) ==== // Generic typed parameters with initializers function foo(x: T = null) { return x; } // ok @@ -20,26 +13,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/genericC ~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'T'. function foo4(x: T, y: U = x) { } // error - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ !!! error TS2322: Type 'T' is not assignable to type 'U'. function foo5(x: U, y: T = x) { } // ok - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. function foo6(x: T, y: U, z: V = y) { } // error - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~~~~~ !!! error TS2322: Type 'U' is not assignable to type 'V'. - function foo7(x: V, y: U = x) { } // should be ok - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~ -!!! error TS2322: Type 'V' is not assignable to type 'U'. \ No newline at end of file +!!! error TS2322: Type 'T' is not assignable to type 'V'. + function foo7(x: V, y: U = x) { } // should be ok \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint2.errors.txt b/tests/baselines/reference/genericConstraint2.errors.txt index c1be6fc2325ad..97d468f5d5d3f 100644 --- a/tests/baselines/reference/genericConstraint2.errors.txt +++ b/tests/baselines/reference/genericConstraint2.errors.txt @@ -1,18 +1,15 @@ -tests/cases/compiler/genericConstraint2.ts(5,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/compiler/genericConstraint2.ts(11,7): error TS2420: Class 'ComparableString' incorrectly implements interface 'Comparable'. Property 'comparer' is missing in type 'ComparableString'. -tests/cases/compiler/genericConstraint2.ts(21,17): error TS2344: Type 'ComparableString' does not satisfy the constraint 'Comparable'. +tests/cases/compiler/genericConstraint2.ts(21,17): error TS2344: Type 'ComparableString' does not satisfy the constraint 'Comparable'. Property 'comparer' is missing in type 'ComparableString'. -==== tests/cases/compiler/genericConstraint2.ts (3 errors) ==== +==== tests/cases/compiler/genericConstraint2.ts (2 errors) ==== interface Comparable { comparer(other: T): number; } function compare>(x: T, y: T): number { - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. if (x == null) return y == null ? 0 : -1; if (y == null) return 1; return x.comparer(y); @@ -33,5 +30,5 @@ tests/cases/compiler/genericConstraint2.ts(21,17): error TS2344: Type 'Comparabl var b = new ComparableString("b"); var c = compare(a, b); ~~~~~~~~~~~~~~~~ -!!! error TS2344: Type 'ComparableString' does not satisfy the constraint 'Comparable'. +!!! error TS2344: Type 'ComparableString' does not satisfy the constraint 'Comparable'. !!! error TS2344: Property 'comparer' is missing in type 'ComparableString'. \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint3.errors.txt b/tests/baselines/reference/genericConstraint3.errors.txt deleted file mode 100644 index 525b11504fbc0..0000000000000 --- a/tests/baselines/reference/genericConstraint3.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -tests/cases/compiler/genericConstraint3.ts(2,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/genericConstraint3.ts (1 errors) ==== - interface C

{ x: P; } - interface A> { x: U; } - ~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - interface B extends A<{}, { x: {} }> { } // Should not produce an error \ No newline at end of file diff --git a/tests/baselines/reference/genericConstraint3.symbols b/tests/baselines/reference/genericConstraint3.symbols new file mode 100644 index 0000000000000..57cb9d03115af --- /dev/null +++ b/tests/baselines/reference/genericConstraint3.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/genericConstraint3.ts === +interface C

{ x: P; } +>C : Symbol(C, Decl(genericConstraint3.ts, 0, 0)) +>P : Symbol(P, Decl(genericConstraint3.ts, 0, 12)) +>x : Symbol(x, Decl(genericConstraint3.ts, 0, 16)) +>P : Symbol(P, Decl(genericConstraint3.ts, 0, 12)) + +interface A> { x: U; } +>A : Symbol(A, Decl(genericConstraint3.ts, 0, 24)) +>T : Symbol(T, Decl(genericConstraint3.ts, 1, 12)) +>U : Symbol(U, Decl(genericConstraint3.ts, 1, 14)) +>C : Symbol(C, Decl(genericConstraint3.ts, 0, 0)) +>T : Symbol(T, Decl(genericConstraint3.ts, 1, 12)) +>x : Symbol(x, Decl(genericConstraint3.ts, 1, 32)) +>U : Symbol(U, Decl(genericConstraint3.ts, 1, 14)) + +interface B extends A<{}, { x: {} }> { } // Should not produce an error +>B : Symbol(B, Decl(genericConstraint3.ts, 1, 40)) +>A : Symbol(A, Decl(genericConstraint3.ts, 0, 24)) +>x : Symbol(x, Decl(genericConstraint3.ts, 2, 27)) + diff --git a/tests/baselines/reference/genericConstraint3.types b/tests/baselines/reference/genericConstraint3.types new file mode 100644 index 0000000000000..84d6f0676f552 --- /dev/null +++ b/tests/baselines/reference/genericConstraint3.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/genericConstraint3.ts === +interface C

{ x: P; } +>C : C

+>P : P +>x : P +>P : P + +interface A> { x: U; } +>A : A +>T : T +>U : U +>C : C

+>T : T +>x : U +>U : U + +interface B extends A<{}, { x: {} }> { } // Should not produce an error +>B : B +>A : A +>x : {} + diff --git a/tests/baselines/reference/genericMemberFunction.errors.txt b/tests/baselines/reference/genericMemberFunction.errors.txt index 2199966ea5686..1410b6d94e35b 100644 --- a/tests/baselines/reference/genericMemberFunction.errors.txt +++ b/tests/baselines/reference/genericMemberFunction.errors.txt @@ -1,45 +1,30 @@ -tests/cases/compiler/genericMemberFunction.ts(2,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/genericMemberFunction.ts(7,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/genericMemberFunction.ts(10,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/genericMemberFunction.ts(15,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/compiler/genericMemberFunction.ts(16,5): error TS2304: Cannot find name 'a'. tests/cases/compiler/genericMemberFunction.ts(17,5): error TS2304: Cannot find name 'removedFiles'. -tests/cases/compiler/genericMemberFunction.ts(17,30): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/compiler/genericMemberFunction.ts(18,12): error TS2339: Property 'removeFile' does not exist on type 'BuildResult'. -==== tests/cases/compiler/genericMemberFunction.ts (8 errors) ==== +==== tests/cases/compiler/genericMemberFunction.ts (3 errors) ==== export class BuildError{ public parent(): FileWithErrors { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return undefined; } } export class FileWithErrors{ public errors(): BuildError[] { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return undefined; } public parent(): BuildResult { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return undefined; } } export class BuildResult{ public merge(other: BuildResult): void { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. a.b.c.d.e.f.g = 0; ~ !!! error TS2304: Cannot find name 'a'. removedFiles.forEach((each: FileWithErrors) => { ~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'removedFiles'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. this.removeFile(each); ~~~~~~~~~~ !!! error TS2339: Property 'removeFile' does not exist on type 'BuildResult'. diff --git a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt index 43a73e76a3e36..7778e1c3346db 100644 --- a/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt +++ b/tests/baselines/reference/genericMergedDeclarationUsingTypeParameter.errors.txt @@ -1,12 +1,9 @@ -tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts(1,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts(3,19): error TS2304: Cannot find name 'T'. tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts(4,14): error TS2304: Cannot find name 'T'. -==== tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts (3 errors) ==== +==== tests/cases/compiler/genericMergedDeclarationUsingTypeParameter.ts (2 errors) ==== function foo(y: T, z: U) { return y; } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. module foo { export var x: T; ~ diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt deleted file mode 100644 index 1778e092715ed..0000000000000 --- a/tests/baselines/reference/infiniteExpansionThroughInstantiation2.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation2.ts(4,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation2.ts (1 errors) ==== - // instantiating a derived type can cause an infinitely expanding type reference to be generated - // which could be used in an assignment check for constraint satisfaction - - interface AA> // now an error due to referencing type parameter in constraint - ~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - { - x: T - } - - interface BB extends AA> - { - } \ No newline at end of file diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation2.symbols b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.symbols new file mode 100644 index 0000000000000..0c5b0cf5a659b --- /dev/null +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.symbols @@ -0,0 +1,22 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation2.ts === +// instantiating a derived type can cause an infinitely expanding type reference to be generated +// which could be used in an assignment check for constraint satisfaction + +interface AA> // now an error due to referencing type parameter in constraint +>AA : Symbol(AA, Decl(infiniteExpansionThroughInstantiation2.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpansionThroughInstantiation2.ts, 3, 13)) +>AA : Symbol(AA, Decl(infiniteExpansionThroughInstantiation2.ts, 0, 0)) +>T : Symbol(T, Decl(infiniteExpansionThroughInstantiation2.ts, 3, 13)) +{ + x: T +>x : Symbol(x, Decl(infiniteExpansionThroughInstantiation2.ts, 4, 1)) +>T : Symbol(T, Decl(infiniteExpansionThroughInstantiation2.ts, 3, 13)) +} + +interface BB extends AA> +>BB : Symbol(BB, Decl(infiniteExpansionThroughInstantiation2.ts, 6, 1)) +>AA : Symbol(AA, Decl(infiniteExpansionThroughInstantiation2.ts, 0, 0)) +>AA : Symbol(AA, Decl(infiniteExpansionThroughInstantiation2.ts, 0, 0)) +>BB : Symbol(BB, Decl(infiniteExpansionThroughInstantiation2.ts, 6, 1)) +{ +} diff --git a/tests/baselines/reference/infiniteExpansionThroughInstantiation2.types b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.types new file mode 100644 index 0000000000000..c9249b900109b --- /dev/null +++ b/tests/baselines/reference/infiniteExpansionThroughInstantiation2.types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/infiniteExpansionThroughInstantiation2.ts === +// instantiating a derived type can cause an infinitely expanding type reference to be generated +// which could be used in an assignment check for constraint satisfaction + +interface AA> // now an error due to referencing type parameter in constraint +>AA : AA +>T : T +>AA : AA +>T : T +{ + x: T +>x : T +>T : T +} + +interface BB extends AA> +>BB : BB +>AA : AA +>AA : AA +>BB : BB +{ +} diff --git a/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt deleted file mode 100644 index f5d53c582f6a0..0000000000000 --- a/tests/baselines/reference/instantiateConstraintsToTypeArguments2.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts(1,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts(1,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts(2,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts(2,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts (4 errors) ==== - interface A, S extends A> { } - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - interface B, S extends B> extends A, B> { } - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file diff --git a/tests/baselines/reference/instantiateConstraintsToTypeArguments2.symbols b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.symbols new file mode 100644 index 0000000000000..40c886e1b473c --- /dev/null +++ b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts === +interface A, S extends A> { } +>A : Symbol(A, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 0)) +>T : Symbol(T, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 12)) +>A : Symbol(A, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 0)) +>T : Symbol(T, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 12)) +>S : Symbol(S, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 30)) +>S : Symbol(S, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 30)) +>A : Symbol(A, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 0)) +>T : Symbol(T, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 12)) +>S : Symbol(S, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 30)) + +interface B, S extends B> extends A, B> { } +>B : Symbol(B, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 53)) +>T : Symbol(T, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 12)) +>B : Symbol(B, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 53)) +>T : Symbol(T, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 12)) +>S : Symbol(S, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 30)) +>S : Symbol(S, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 30)) +>B : Symbol(B, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 53)) +>T : Symbol(T, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 12)) +>S : Symbol(S, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 30)) +>A : Symbol(A, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 0)) +>B : Symbol(B, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 53)) +>T : Symbol(T, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 12)) +>S : Symbol(S, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 30)) +>B : Symbol(B, Decl(instantiateConstraintsToTypeArguments2.ts, 0, 53)) +>T : Symbol(T, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 12)) +>S : Symbol(S, Decl(instantiateConstraintsToTypeArguments2.ts, 1, 30)) + diff --git a/tests/baselines/reference/instantiateConstraintsToTypeArguments2.types b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.types new file mode 100644 index 0000000000000..1952a661c167d --- /dev/null +++ b/tests/baselines/reference/instantiateConstraintsToTypeArguments2.types @@ -0,0 +1,30 @@ +=== tests/cases/compiler/instantiateConstraintsToTypeArguments2.ts === +interface A, S extends A> { } +>A : A +>T : T +>A : A +>T : T +>S : S +>S : S +>A : A +>T : T +>S : S + +interface B, S extends B> extends A, B> { } +>B : B +>T : T +>B : B +>T : T +>S : S +>S : S +>B : B +>T : T +>S : S +>A : A +>B : B +>T : T +>S : S +>B : B +>T : T +>S : S + diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt b/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt deleted file mode 100644 index db62abe56886f..0000000000000 --- a/tests/baselines/reference/instantiatedBaseTypeConstraints.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/compiler/instantiatedBaseTypeConstraints.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/instantiatedBaseTypeConstraints.ts (1 errors) ==== - interface Foo, C> { - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo(bar: C): void; - } - - class Bar implements Foo { - foo(bar: string): void { - } - } - - - \ No newline at end of file diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints.symbols b/tests/baselines/reference/instantiatedBaseTypeConstraints.symbols new file mode 100644 index 0000000000000..e92097c309c5f --- /dev/null +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/instantiatedBaseTypeConstraints.ts === +interface Foo, C> { +>Foo : Symbol(Foo, Decl(instantiatedBaseTypeConstraints.ts, 0, 0)) +>T : Symbol(T, Decl(instantiatedBaseTypeConstraints.ts, 0, 14)) +>Foo : Symbol(Foo, Decl(instantiatedBaseTypeConstraints.ts, 0, 0)) +>T : Symbol(T, Decl(instantiatedBaseTypeConstraints.ts, 0, 14)) +>C : Symbol(C, Decl(instantiatedBaseTypeConstraints.ts, 0, 34)) +>C : Symbol(C, Decl(instantiatedBaseTypeConstraints.ts, 0, 34)) + + foo(bar: C): void; +>foo : Symbol(foo, Decl(instantiatedBaseTypeConstraints.ts, 0, 39)) +>bar : Symbol(bar, Decl(instantiatedBaseTypeConstraints.ts, 1, 6)) +>C : Symbol(C, Decl(instantiatedBaseTypeConstraints.ts, 0, 34)) +} + +class Bar implements Foo { +>Bar : Symbol(Bar, Decl(instantiatedBaseTypeConstraints.ts, 2, 1)) +>Foo : Symbol(Foo, Decl(instantiatedBaseTypeConstraints.ts, 0, 0)) +>Bar : Symbol(Bar, Decl(instantiatedBaseTypeConstraints.ts, 2, 1)) + + foo(bar: string): void { +>foo : Symbol(foo, Decl(instantiatedBaseTypeConstraints.ts, 4, 39)) +>bar : Symbol(bar, Decl(instantiatedBaseTypeConstraints.ts, 5, 6)) + } +} + + + diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints.types b/tests/baselines/reference/instantiatedBaseTypeConstraints.types new file mode 100644 index 0000000000000..e83d8250158a4 --- /dev/null +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints.types @@ -0,0 +1,28 @@ +=== tests/cases/compiler/instantiatedBaseTypeConstraints.ts === +interface Foo, C> { +>Foo : Foo +>T : T +>Foo : Foo +>T : T +>C : C +>C : C + + foo(bar: C): void; +>foo : (bar: C) => void +>bar : C +>C : C +} + +class Bar implements Foo { +>Bar : Bar +>Foo : Foo +>Bar : Bar + + foo(bar: string): void { +>foo : (bar: string) => void +>bar : string + } +} + + + diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt b/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt deleted file mode 100644 index d5c6d838a843d..0000000000000 --- a/tests/baselines/reference/instantiatedBaseTypeConstraints2.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/instantiatedBaseTypeConstraints2.ts(1,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/instantiatedBaseTypeConstraints2.ts(1,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/instantiatedBaseTypeConstraints2.ts (2 errors) ==== - interface A, S extends A> { } - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - interface B extends A, B> { } \ No newline at end of file diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints2.symbols b/tests/baselines/reference/instantiatedBaseTypeConstraints2.symbols new file mode 100644 index 0000000000000..9122bbed97525 --- /dev/null +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints2.symbols @@ -0,0 +1,21 @@ +=== tests/cases/compiler/instantiatedBaseTypeConstraints2.ts === +interface A, S extends A> { } +>A : Symbol(A, Decl(instantiatedBaseTypeConstraints2.ts, 0, 0)) +>T : Symbol(T, Decl(instantiatedBaseTypeConstraints2.ts, 0, 12)) +>A : Symbol(A, Decl(instantiatedBaseTypeConstraints2.ts, 0, 0)) +>T : Symbol(T, Decl(instantiatedBaseTypeConstraints2.ts, 0, 12)) +>S : Symbol(S, Decl(instantiatedBaseTypeConstraints2.ts, 0, 30)) +>S : Symbol(S, Decl(instantiatedBaseTypeConstraints2.ts, 0, 30)) +>A : Symbol(A, Decl(instantiatedBaseTypeConstraints2.ts, 0, 0)) +>T : Symbol(T, Decl(instantiatedBaseTypeConstraints2.ts, 0, 12)) +>S : Symbol(S, Decl(instantiatedBaseTypeConstraints2.ts, 0, 30)) + +interface B extends A, B> { } +>B : Symbol(B, Decl(instantiatedBaseTypeConstraints2.ts, 0, 53)) +>U : Symbol(U, Decl(instantiatedBaseTypeConstraints2.ts, 1, 12)) +>A : Symbol(A, Decl(instantiatedBaseTypeConstraints2.ts, 0, 0)) +>B : Symbol(B, Decl(instantiatedBaseTypeConstraints2.ts, 0, 53)) +>U : Symbol(U, Decl(instantiatedBaseTypeConstraints2.ts, 1, 12)) +>B : Symbol(B, Decl(instantiatedBaseTypeConstraints2.ts, 0, 53)) +>U : Symbol(U, Decl(instantiatedBaseTypeConstraints2.ts, 1, 12)) + diff --git a/tests/baselines/reference/instantiatedBaseTypeConstraints2.types b/tests/baselines/reference/instantiatedBaseTypeConstraints2.types new file mode 100644 index 0000000000000..3b6ca2ea75bba --- /dev/null +++ b/tests/baselines/reference/instantiatedBaseTypeConstraints2.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/instantiatedBaseTypeConstraints2.ts === +interface A, S extends A> { } +>A : A +>T : T +>A : A +>T : T +>S : S +>S : S +>A : A +>T : T +>S : S + +interface B extends A, B> { } +>B : B +>U : U +>A : A +>B : B +>U : U +>B : B +>U : U + diff --git a/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt b/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt index 9afd0d3773397..e4b37db8a7a95 100644 --- a/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt +++ b/tests/baselines/reference/interfaceWithMultipleDeclarations.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/interfaceWithMultipleDeclarations.ts(3,11): error TS2428: All declarations of an interface must have identical type parameters. tests/cases/compiler/interfaceWithMultipleDeclarations.ts(5,11): error TS2428: All declarations of an interface must have identical type parameters. -tests/cases/compiler/interfaceWithMultipleDeclarations.ts(5,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/compiler/interfaceWithMultipleDeclarations.ts(7,11): error TS2428: All declarations of an interface must have identical type parameters. tests/cases/compiler/interfaceWithMultipleDeclarations.ts(9,11): error TS2428: All declarations of an interface must have identical type parameters. -tests/cases/compiler/interfaceWithMultipleDeclarations.ts(9,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/compiler/interfaceWithMultipleDeclarations.ts(11,11): error TS2428: All declarations of an interface must have identical type parameters. tests/cases/compiler/interfaceWithMultipleDeclarations.ts(16,11): error TS2428: All declarations of an interface must have identical type parameters. tests/cases/compiler/interfaceWithMultipleDeclarations.ts(18,11): error TS2428: All declarations of an interface must have identical type parameters. @@ -11,11 +9,9 @@ tests/cases/compiler/interfaceWithMultipleDeclarations.ts(20,11): error TS2428: tests/cases/compiler/interfaceWithMultipleDeclarations.ts(22,11): error TS2428: All declarations of an interface must have identical type parameters. tests/cases/compiler/interfaceWithMultipleDeclarations.ts(24,11): error TS2428: All declarations of an interface must have identical type parameters. tests/cases/compiler/interfaceWithMultipleDeclarations.ts(29,11): error TS2428: All declarations of an interface must have identical type parameters. -tests/cases/compiler/interfaceWithMultipleDeclarations.ts(34,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/interfaceWithMultipleDeclarations.ts(36,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -==== tests/cases/compiler/interfaceWithMultipleDeclarations.ts (15 errors) ==== +==== tests/cases/compiler/interfaceWithMultipleDeclarations.ts (11 errors) ==== interface I1 { } interface I1 { // Name mismatch @@ -25,8 +21,6 @@ tests/cases/compiler/interfaceWithMultipleDeclarations.ts(36,14): error TS2313: interface I1 { // Length mismatch ~~ !!! error TS2428: All declarations of an interface must have identical type parameters. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface I1 { // constraint present ~~ @@ -35,8 +29,6 @@ tests/cases/compiler/interfaceWithMultipleDeclarations.ts(36,14): error TS2313: interface I1 { // Length mismatch ~~ !!! error TS2428: All declarations of an interface must have identical type parameters. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface I1 { // Length mismatch ~~ @@ -76,10 +68,6 @@ tests/cases/compiler/interfaceWithMultipleDeclarations.ts(36,14): error TS2313: class Foo { } interface I4> { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } interface I4> { // Should not be error - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } \ No newline at end of file diff --git a/tests/baselines/reference/invalidConstraint1.errors.txt b/tests/baselines/reference/invalidConstraint1.errors.txt index bac8f805c0fb9..e8a4ec43c09c8 100644 --- a/tests/baselines/reference/invalidConstraint1.errors.txt +++ b/tests/baselines/reference/invalidConstraint1.errors.txt @@ -1,12 +1,16 @@ -tests/cases/compiler/invalidConstraint1.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/invalidConstraint1.ts(4,11): error TS2344: Type '{ a: number; }' does not satisfy the constraint '{ a: string; }'. + Types of property 'a' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/compiler/invalidConstraint1.ts (1 errors) ==== function f() { - ~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. return undefined; } f(); // should error + ~~~~~~~~~~~~~ +!!! error TS2344: Type '{ a: number; }' does not satisfy the constraint '{ a: string; }'. +!!! error TS2344: Types of property 'a' are incompatible. +!!! error TS2344: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt b/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt deleted file mode 100644 index edd917a460285..0000000000000 --- a/tests/baselines/reference/matchingOfObjectLiteralConstraints.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/compiler/matchingOfObjectLiteralConstraints.ts(1,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/matchingOfObjectLiteralConstraints.ts (1 errors) ==== - function foo2(x: U, z: T) { } - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo2({ y: "foo" }, "foo"); - - \ No newline at end of file diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.symbols b/tests/baselines/reference/matchingOfObjectLiteralConstraints.symbols new file mode 100644 index 0000000000000..8a7fb7b47fc50 --- /dev/null +++ b/tests/baselines/reference/matchingOfObjectLiteralConstraints.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/matchingOfObjectLiteralConstraints.ts === +function foo2(x: U, z: T) { } +>foo2 : Symbol(foo2, Decl(matchingOfObjectLiteralConstraints.ts, 0, 0)) +>T : Symbol(T, Decl(matchingOfObjectLiteralConstraints.ts, 0, 14)) +>U : Symbol(U, Decl(matchingOfObjectLiteralConstraints.ts, 0, 16)) +>y : Symbol(y, Decl(matchingOfObjectLiteralConstraints.ts, 0, 28)) +>T : Symbol(T, Decl(matchingOfObjectLiteralConstraints.ts, 0, 14)) +>x : Symbol(x, Decl(matchingOfObjectLiteralConstraints.ts, 0, 38)) +>U : Symbol(U, Decl(matchingOfObjectLiteralConstraints.ts, 0, 16)) +>z : Symbol(z, Decl(matchingOfObjectLiteralConstraints.ts, 0, 43)) +>T : Symbol(T, Decl(matchingOfObjectLiteralConstraints.ts, 0, 14)) + +foo2({ y: "foo" }, "foo"); +>foo2 : Symbol(foo2, Decl(matchingOfObjectLiteralConstraints.ts, 0, 0)) +>y : Symbol(y, Decl(matchingOfObjectLiteralConstraints.ts, 1, 6)) + + diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.types b/tests/baselines/reference/matchingOfObjectLiteralConstraints.types new file mode 100644 index 0000000000000..f694571c72706 --- /dev/null +++ b/tests/baselines/reference/matchingOfObjectLiteralConstraints.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/matchingOfObjectLiteralConstraints.ts === +function foo2(x: U, z: T) { } +>foo2 : (x: U, z: T) => void +>T : T +>U : U +>y : T +>T : T +>x : U +>U : U +>z : T +>T : T + +foo2({ y: "foo" }, "foo"); +>foo2({ y: "foo" }, "foo") : void +>foo2 : (x: U, z: T) => void +>{ y: "foo" } : { y: string; } +>y : string +>"foo" : string +>"foo" : string + + diff --git a/tests/baselines/reference/maxConstraints.errors.txt b/tests/baselines/reference/maxConstraints.errors.txt index 16ae5bd2063e1..03e7158f725cb 100644 --- a/tests/baselines/reference/maxConstraints.errors.txt +++ b/tests/baselines/reference/maxConstraints.errors.txt @@ -1,19 +1,16 @@ -tests/cases/compiler/maxConstraints.ts(5,6): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. +tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. Property 'compareTo' is missing in type 'Number'. -==== tests/cases/compiler/maxConstraints.ts (2 errors) ==== +==== tests/cases/compiler/maxConstraints.ts (1 errors) ==== interface Comparable { compareTo(other: T): number; } interface Comparer { >(x: T, y: T): T; - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; var maxResult = max2(1, 2); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. !!! error TS2345: Property 'compareTo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt index 1f2f432c9da40..f112a590071a9 100644 --- a/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt +++ b/tests/baselines/reference/objectTypeWithRecursiveWrappedPropertyCheckedNominally.errors.txt @@ -8,15 +8,11 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec Type 'MyList' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(31,5): error TS2322: Type 'T' is not assignable to type 'U'. Type 'List' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(41,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(42,5): error TS2322: Type 'U' is not assignable to type 'T'. Type 'MyList' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(43,5): error TS2322: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(48,5): error TS2322: Type 'T' is not assignable to type 'List'. -tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts(50,5): error TS2322: Type 'T' is not assignable to type 'MyList'. -==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts (9 errors) ==== +==== tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRecursiveWrappedPropertyCheckedNominally.ts (5 errors) ==== // Types with infinitely expanding recursive types are type checked nominally class List { @@ -72,25 +68,17 @@ tests/cases/conformance/types/typeRelationships/recursiveTypes/objectTypeWithRec } function foo2>(t: T, u: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ !!! error TS2322: Type 'U' is not assignable to type 'T'. !!! error TS2322: Type 'MyList' is not assignable to type 'T'. u = t; // was error, ok after constraint made illegal, doesn't matter - ~ -!!! error TS2322: Type 'T' is not assignable to type 'U'. var a: List; var b: MyList; a = t; // error - ~ -!!! error TS2322: Type 'T' is not assignable to type 'List'. a = u; // error b = t; // ok - ~ -!!! error TS2322: Type 'T' is not assignable to type 'MyList'. b = u; // ok } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt deleted file mode 100644 index dce23ed96e568..0000000000000 --- a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.errors.txt +++ /dev/null @@ -1,22 +0,0 @@ -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts(2,8): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts (1 errors) ==== - interface A { - (x: T, y: S): void - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - }>(x: T, y: T): void - ~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - interface B { - (x: U, y: U): void - } - - // ok, not considered identical because the steps of contextual signature instantiation create fresh type parameters - function foo(x: A); - function foo(x: B); // error after constraints above made illegal - function foo(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.symbols b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.symbols new file mode 100644 index 0000000000000..66314d9c5dbad --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.symbols @@ -0,0 +1,49 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts === +interface A { +>A : Symbol(A, Decl(objectTypesIdentityWithComplexConstraints.ts, 0, 0)) + + T : Symbol(T, Decl(objectTypesIdentityWithComplexConstraints.ts, 1, 7)) + + (x: T, y: S): void +>S : Symbol(S, Decl(objectTypesIdentityWithComplexConstraints.ts, 2, 13)) +>A : Symbol(A, Decl(objectTypesIdentityWithComplexConstraints.ts, 0, 0)) +>x : Symbol(x, Decl(objectTypesIdentityWithComplexConstraints.ts, 2, 26)) +>T : Symbol(T, Decl(objectTypesIdentityWithComplexConstraints.ts, 1, 7)) +>y : Symbol(y, Decl(objectTypesIdentityWithComplexConstraints.ts, 2, 31)) +>S : Symbol(S, Decl(objectTypesIdentityWithComplexConstraints.ts, 2, 13)) + + }>(x: T, y: T): void +>x : Symbol(x, Decl(objectTypesIdentityWithComplexConstraints.ts, 3, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithComplexConstraints.ts, 1, 7)) +>y : Symbol(y, Decl(objectTypesIdentityWithComplexConstraints.ts, 3, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithComplexConstraints.ts, 1, 7)) +} + +interface B { +>B : Symbol(B, Decl(objectTypesIdentityWithComplexConstraints.ts, 4, 1)) + + (x: U, y: U): void +>U : Symbol(U, Decl(objectTypesIdentityWithComplexConstraints.ts, 7, 7)) +>B : Symbol(B, Decl(objectTypesIdentityWithComplexConstraints.ts, 4, 1)) +>x : Symbol(x, Decl(objectTypesIdentityWithComplexConstraints.ts, 7, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithComplexConstraints.ts, 7, 7)) +>y : Symbol(y, Decl(objectTypesIdentityWithComplexConstraints.ts, 7, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithComplexConstraints.ts, 7, 7)) +} + +// ok, not considered identical because the steps of contextual signature instantiation create fresh type parameters +function foo(x: A); +>foo : Symbol(foo, Decl(objectTypesIdentityWithComplexConstraints.ts, 8, 1), Decl(objectTypesIdentityWithComplexConstraints.ts, 11, 19), Decl(objectTypesIdentityWithComplexConstraints.ts, 12, 19)) +>x : Symbol(x, Decl(objectTypesIdentityWithComplexConstraints.ts, 11, 13)) +>A : Symbol(A, Decl(objectTypesIdentityWithComplexConstraints.ts, 0, 0)) + +function foo(x: B); // error after constraints above made illegal +>foo : Symbol(foo, Decl(objectTypesIdentityWithComplexConstraints.ts, 8, 1), Decl(objectTypesIdentityWithComplexConstraints.ts, 11, 19), Decl(objectTypesIdentityWithComplexConstraints.ts, 12, 19)) +>x : Symbol(x, Decl(objectTypesIdentityWithComplexConstraints.ts, 12, 13)) +>B : Symbol(B, Decl(objectTypesIdentityWithComplexConstraints.ts, 4, 1)) + +function foo(x: any) { } +>foo : Symbol(foo, Decl(objectTypesIdentityWithComplexConstraints.ts, 8, 1), Decl(objectTypesIdentityWithComplexConstraints.ts, 11, 19), Decl(objectTypesIdentityWithComplexConstraints.ts, 12, 19)) +>x : Symbol(x, Decl(objectTypesIdentityWithComplexConstraints.ts, 13, 13)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.types b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.types new file mode 100644 index 0000000000000..aeb1c467dce6b --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithComplexConstraints.types @@ -0,0 +1,49 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithComplexConstraints.ts === +interface A { +>A : A + + T : T + + (x: T, y: S): void +>S : S +>A : A +>x : T +>T : T +>y : S +>S : S + + }>(x: T, y: T): void +>x : T +>T : T +>y : T +>T : T +} + +interface B { +>B : B + + (x: U, y: U): void +>U : U +>B : B +>x : U +>U : U +>y : U +>U : U +} + +// ok, not considered identical because the steps of contextual signature instantiation create fresh type parameters +function foo(x: A); +>foo : { (x: A): any; (x: B): any; } +>x : A +>A : A + +function foo(x: B); // error after constraints above made illegal +>foo : { (x: A): any; (x: B): any; } +>x : B +>B : B + +function foo(x: any) { } +>foo : { (x: A): any; (x: B): any; } +>x : any + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt deleted file mode 100644 index b1221bb21aaf0..0000000000000 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.errors.txt +++ /dev/null @@ -1,141 +0,0 @@ -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(6,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(9,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(13,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(17,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(21,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(26,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(29,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts(30,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts (8 errors) ==== - // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those - // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, - // optional or rest) and types, and identical return types. - - class A { - foo(x: T, y: U): string { return null; } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - class B> { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo(x: T, y: U): string { return null; } - } - - class C { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo(x: T, y: U): string { return null; } - } - - class D { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo(x: T, y: U): string { return null; } - } - - interface I { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo(x: T, y: U): string; - } - - interface I2 { - foo(x: T, y: U): string; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - var a: { foo>(x: T, y: U): string } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var b = { foo(x: T, y: U) { return ''; } }; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - function foo1(x: A); - function foo1(x: A); // error - function foo1(x: any) { } - - function foo1b(x: B, Array>); - function foo1b(x: B, Array>); // error - function foo1b(x: any) { } - - function foo1c(x: C); - function foo1c(x: C); // error - function foo1c(x: any) { } - - function foo2(x: I); - function foo2(x: I); // error - function foo2(x: any) { } - - function foo3(x: typeof a); - function foo3(x: typeof a); // error - function foo3(x: any) { } - - function foo4(x: typeof b); - function foo4(x: typeof b); // error - function foo4(x: any) { } - - function foo5(x: A); - function foo5(x: B, Array>); // ok - function foo5(x: any) { } - - function foo5b(x: A); - function foo5b(x: C); // ok - function foo5b(x: any) { } - - function foo5c(x: C); - function foo5c(x: D); // ok - function foo5c(x: any) { } - - function foo6c(x: C); - function foo6c(x: D); // error, "any" does not satisfy the constraint - function foo6c(x: any) { } - - function foo6(x: A); - function foo6(x: I); // ok - function foo6(x: any) { } - - function foo7(x: A); - function foo7(x: typeof a); // ok - function foo7(x: any) { } - - function foo8(x: B, Array>); - function foo8(x: I); // ok - function foo8(x: any) { } - - function foo9(x: B, Array>); - function foo9(x: C); // ok - function foo9(x: any) { } - - function foo10(x: B, Array>); - function foo10(x: typeof a); // ok - function foo10(x: any) { } - - function foo11(x: B, Array>); - function foo11(x: typeof b); // ok - function foo11(x: any) { } - - function foo12(x: I); - function foo12(x: C); // ok - function foo12(x: any) { } - - function foo12b(x: I2); - function foo12b(x: C); // ok - function foo12b(x: any) { } - - function foo13(x: I); - function foo13(x: typeof a); // ok - function foo13(x: any) { } - - function foo14(x: I); - function foo14(x: typeof b); // ok - function foo14(x: any) { } - - function foo15(x: I2); - function foo15(x: C); // ok - function foo15(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.symbols new file mode 100644 index 0000000000000..e8c34a1bf99ab --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.symbols @@ -0,0 +1,462 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 0, 0)) + + foo(x: T, y: U): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 4, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 20)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 37)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 42)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 20)) +} + +class B> { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 8, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 8, 20)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + foo(x: T, y: U): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 8, 47)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 9, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 9, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 8, 20)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 12, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 12, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 12, 20)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + foo(x: T, y: U): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 12, 40)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 13, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 12, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 13, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 12, 20)) +} + +class D { +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 16, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 16, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 16, 20)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + foo(x: T, y: U): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 16, 40)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 16, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 17, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 16, 20)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 18, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 20, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 20, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 20, 24)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + foo(x: T, y: U): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 20, 44)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 21, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 20, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 21, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 20, 24)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 22, 1)) + + foo(x: T, y: U): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 24, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 25, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 25, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 25, 20)) +>Boolean : Symbol(Boolean, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 25, 40)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 25, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 25, 45)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 25, 20)) +} + +var a: { foo>(x: T, y: U): string } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 51)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 56)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 25)) + +var b = { foo(x: T, y: U) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 26)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 26)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 45)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 50)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 26)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 74), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 31, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 32, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 31, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 0, 0)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 74), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 31, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 32, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 32, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 0, 0)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 74), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 31, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 32, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 33, 14)) + +function foo1b(x: B, Array>); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 33, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 35, 51), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 36, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 35, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo1b(x: B, Array>); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 33, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 35, 51), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 36, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 36, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 33, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 35, 51), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 36, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 37, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 39, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 40, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 39, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 39, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 40, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 40, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 39, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 40, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 41, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 41, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 43, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 43, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 18, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 41, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 43, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 18, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 41, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 43, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 44, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 45, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 47, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 48, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 45, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 47, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 48, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 49, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 51, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 52, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 51, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 51, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 52, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 52, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 51, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 52, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 53, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 55, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 56, 50)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 55, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 0, 0)) + +function foo5(x: B, Array>); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 55, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 56, 50)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 56, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 55, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 56, 50)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 57, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 57, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 59, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 59, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 0, 0)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 57, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 59, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 57, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 59, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 60, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 61, 15)) + +function foo5c(x: C); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 61, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 63, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 64, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 63, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo5c(x: D); // ok +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 61, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 63, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 64, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 64, 15)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 61, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 63, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 64, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 65, 15)) + +function foo6c(x: C); +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 65, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 67, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 68, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 67, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo6c(x: D); // error, "any" does not satisfy the constraint +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 65, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 67, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 68, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 68, 15)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo6c(x: any) { } +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 65, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 67, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 68, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 69, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 69, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 71, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 71, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 0, 0)) + +function foo6(x: I); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 69, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 71, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 72, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 18, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 69, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 71, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 72, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 73, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 75, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 76, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 75, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 0, 0)) + +function foo7(x: typeof a); // ok +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 75, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 76, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 76, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 75, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 76, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 77, 14)) + +function foo8(x: B, Array>); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 77, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 79, 50), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 80, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 79, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 77, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 79, 50), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 80, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 80, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 18, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 77, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 79, 50), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 80, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 81, 14)) + +function foo9(x: B, Array>); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 81, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 83, 50), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 84, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 83, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo9(x: C); // ok +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 81, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 83, 50), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 84, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 84, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 81, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 83, 50), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 84, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 85, 14)) + +function foo10(x: B, Array>); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 85, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 87, 51), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 87, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 85, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 87, 51), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 88, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 85, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 87, 51), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 88, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 89, 15)) + +function foo11(x: B, Array>); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 89, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 91, 51), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 91, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 6, 1)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 89, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 91, 51), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 92, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 89, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 91, 51), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 92, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 93, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 96, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 95, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 18, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 96, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 96, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 95, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 96, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 97, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 99, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 100, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 99, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 22, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 99, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 100, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 100, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 99, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 100, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 101, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 101, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 103, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 104, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 103, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 18, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 101, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 103, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 104, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 104, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 28, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 101, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 103, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 104, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 105, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 105, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 107, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 108, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 107, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 18, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 105, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 107, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 108, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 108, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 29, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 105, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 107, 37), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 108, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 109, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 109, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 111, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 112, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 111, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 22, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 109, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 111, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 112, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 112, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 10, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 109, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 111, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 112, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 113, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types new file mode 100644 index 0000000000000..4974b0874eba2 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.types @@ -0,0 +1,468 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class A { +>A : A + + foo(x: T, y: U): string { return null; } +>foo : (x: T, y: U) => string +>T : T +>U : U +>U : U +>Date : Date +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class B> { +>B : B +>T : T +>U : U +>U : U +>Array : T[] + + foo(x: T, y: U): string { return null; } +>foo : (x: T, y: U) => string +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class C { +>C : C +>T : T +>U : U +>U : U +>String : String + + foo(x: T, y: U): string { return null; } +>foo : (x: T, y: U) => string +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class D { +>D : D +>T : T +>U : U +>U : U +>Number : Number + + foo(x: T, y: U): string { return null; } +>foo : (x: T, y: U) => string +>x : T +>T : T +>y : U +>U : U +>null : null +} + +interface I { +>I : I +>T : T +>U : U +>U : U +>Number : Number + + foo(x: T, y: U): string; +>foo : (x: T, y: U) => string +>x : T +>T : T +>y : U +>U : U +} + +interface I2 { +>I2 : I2 + + foo(x: T, y: U): string; +>foo : (x: T, y: U) => string +>T : T +>U : U +>U : U +>Boolean : Boolean +>x : T +>T : T +>y : U +>U : U +} + +var a: { foo>(x: T, y: U): string } +>a : { foo(x: T, y: U): string; } +>foo : (x: T, y: U) => string +>T : T +>U : U +>U : U +>Array : T[] +>x : T +>T : T +>y : U +>U : U + +var b = { foo(x: T, y: U) { return ''; } }; +>b : { foo(x: T, y: U): string; } +>{ foo(x: T, y: U) { return ''; } } : { foo(x: T, y: U): string; } +>foo : (x: T, y: U) => string +>T : T +>U : U +>U : U +>RegExp : RegExp +>x : T +>T : T +>y : U +>U : U +>'' : string + +function foo1(x: A); +>foo1 : { (x: A): any; (x: A): any; } +>x : A +>A : A + +function foo1(x: A); // error +>foo1 : { (x: A): any; (x: A): any; } +>x : A +>A : A + +function foo1(x: any) { } +>foo1 : { (x: A): any; (x: A): any; } +>x : any + +function foo1b(x: B, Array>); +>foo1b : { (x: B): any; (x: B): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo1b(x: B, Array>); // error +>foo1b : { (x: B): any; (x: B): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo1b(x: any) { } +>foo1b : { (x: B): any; (x: B): any; } +>x : any + +function foo1c(x: C); +>foo1c : { (x: C): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo1c(x: C); // error +>foo1c : { (x: C): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo1c(x: any) { } +>foo1c : { (x: C): any; (x: C): any; } +>x : any + +function foo2(x: I); +>foo2 : { (x: I): any; (x: I): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo2(x: I); // error +>foo2 : { (x: I): any; (x: I): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo2(x: any) { } +>foo2 : { (x: I): any; (x: I): any; } +>x : any + +function foo3(x: typeof a); +>foo3 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo3(x: typeof a); // error +>foo3 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo3(x: any) { } +>foo3 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo4(x: typeof b); +>foo4 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>b : { foo(x: T, y: U): string; } + +function foo4(x: typeof b); // error +>foo4 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>b : { foo(x: T, y: U): string; } + +function foo4(x: any) { } +>foo4 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo5(x: A); +>foo5 : { (x: A): any; (x: B): any; } +>x : A +>A : A + +function foo5(x: B, Array>); // ok +>foo5 : { (x: A): any; (x: B): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo5(x: any) { } +>foo5 : { (x: A): any; (x: B): any; } +>x : any + +function foo5b(x: A); +>foo5b : { (x: A): any; (x: C): any; } +>x : A +>A : A + +function foo5b(x: C); // ok +>foo5b : { (x: A): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo5b(x: any) { } +>foo5b : { (x: A): any; (x: C): any; } +>x : any + +function foo5c(x: C); +>foo5c : { (x: C): any; (x: D): any; } +>x : C +>C : C +>String : String +>String : String + +function foo5c(x: D); // ok +>foo5c : { (x: C): any; (x: D): any; } +>x : D +>D : D +>Number : Number +>Number : Number + +function foo5c(x: any) { } +>foo5c : { (x: C): any; (x: D): any; } +>x : any + +function foo6c(x: C); +>foo6c : { (x: C): any; (x: D): any; } +>x : C +>C : C +>String : String +>String : String + +function foo6c(x: D); // error, "any" does not satisfy the constraint +>foo6c : { (x: C): any; (x: D): any; } +>x : D +>D : D +>Number : Number + +function foo6c(x: any) { } +>foo6c : { (x: C): any; (x: D): any; } +>x : any + +function foo6(x: A); +>foo6 : { (x: A): any; (x: I): any; } +>x : A +>A : A + +function foo6(x: I); // ok +>foo6 : { (x: A): any; (x: I): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo6(x: any) { } +>foo6 : { (x: A): any; (x: I): any; } +>x : any + +function foo7(x: A); +>foo7 : { (x: A): any; (x: { foo(x: T, y: U): string; }): any; } +>x : A +>A : A + +function foo7(x: typeof a); // ok +>foo7 : { (x: A): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo7(x: any) { } +>foo7 : { (x: A): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo8(x: B, Array>); +>foo8 : { (x: B): any; (x: I): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo8(x: I); // ok +>foo8 : { (x: B): any; (x: I): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo8(x: any) { } +>foo8 : { (x: B): any; (x: I): any; } +>x : any + +function foo9(x: B, Array>); +>foo9 : { (x: B): any; (x: C): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo9(x: C); // ok +>foo9 : { (x: B): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo9(x: any) { } +>foo9 : { (x: B): any; (x: C): any; } +>x : any + +function foo10(x: B, Array>); +>foo10 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo10(x: typeof a); // ok +>foo10 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo10(x: any) { } +>foo10 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo11(x: B, Array>); +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo11(x: typeof b); // ok +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>b : { foo(x: T, y: U): string; } + +function foo11(x: any) { } +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo12(x: I); +>foo12 : { (x: I): any; (x: C): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo12(x: C); // ok +>foo12 : { (x: I): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo12(x: any) { } +>foo12 : { (x: I): any; (x: C): any; } +>x : any + +function foo12b(x: I2); +>foo12b : { (x: I2): any; (x: C): any; } +>x : I2 +>I2 : I2 + +function foo12b(x: C); // ok +>foo12b : { (x: I2): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo12b(x: any) { } +>foo12b : { (x: I2): any; (x: C): any; } +>x : any + +function foo13(x: I); +>foo13 : { (x: I): any; (x: { foo(x: T, y: U): string; }): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo13(x: typeof a); // ok +>foo13 : { (x: I): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo13(x: any) { } +>foo13 : { (x: I): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo14(x: I); +>foo14 : { (x: I): any; (x: { foo(x: T, y: U): string; }): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo14(x: typeof b); // ok +>foo14 : { (x: I): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>b : { foo(x: T, y: U): string; } + +function foo14(x: any) { } +>foo14 : { (x: I): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo15(x: I2); +>foo15 : { (x: I2): any; (x: C): any; } +>x : I2 +>I2 : I2 + +function foo15(x: C); // ok +>foo15 : { (x: I2): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo15(x: any) { } +>foo15 : { (x: I2): any; (x: C): any; } +>x : any + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt deleted file mode 100644 index 42e7f11e9399b..0000000000000 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.errors.txt +++ /dev/null @@ -1,150 +0,0 @@ -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(15,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(18,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(22,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(26,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(30,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(35,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(38,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts(39,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts (8 errors) ==== - // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those - // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, - // optional or rest) and types, and identical return types. - - class One { foo: string } - class Two { foo: string } - interface Three { foo: string } - interface Four { foo: T } - interface Five extends Four { } - interface Six { - foo: T; - } - - class A { - foo(x: T, y: U): string { return null; } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - class B { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo(x: T, y: U): string { return null; } - } - - class C { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo(x: T, y: U): string { return null; } - } - - class D> { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo(x: T, y: U): string { return null; } - } - - interface I> { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo(x: T, y: U): string; - } - - interface I2 { - foo>(x: T, y: U): string; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - var a: { foo(x: T, y: U): string } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var b = { foo(x: T, y: U) { return ''; } }; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - function foo1(x: A); - function foo1(x: A); // error - function foo1(x: any) { } - - function foo1b(x: B); - function foo1b(x: B); // error - function foo1b(x: any) { } - - function foo1c(x: C); - function foo1c(x: C); // error - function foo1c(x: any) { } - - function foo2(x: I, Five>); - function foo2(x: I, Five>); // error - function foo2(x: any) { } - - function foo3(x: typeof a); - function foo3(x: typeof a); // error - function foo3(x: any) { } - - function foo4(x: typeof b); - function foo4(x: typeof b); // error - function foo4(x: any) { } - - function foo5(x: A); - function foo5(x: B); // ok - function foo5(x: any) { } - - function foo5b(x: A); - function foo5b(x: C); // ok - function foo5b(x: any) { } - - function foo5c(x: C); - function foo5c(x: D, Four>); // error - function foo5c(x: any) { } - - function foo6c(x: C); - function foo6c(x: D, Four>); // error - function foo6c(x: any) { } - - function foo6(x: A); - function foo6(x: I, Five>); // ok - function foo6(x: any) { } - - function foo7(x: A); - function foo7(x: typeof a); // error - function foo7(x: any) { } - - function foo8(x: B); - function foo8(x: I, Five>); // error - function foo8(x: any) { } - - function foo9(x: B); - function foo9(x: C); // error - function foo9(x: any) { } - - function foo10(x: B); - function foo10(x: typeof a); // ok - function foo10(x: any) { } - - function foo11(x: B); - function foo11(x: typeof b); // ok - function foo11(x: any) { } - - function foo12(x: I, Five>); - function foo12(x: C); // error - function foo12(x: any) { } - - function foo12b(x: I2); - function foo12b(x: C); // ok - function foo12b(x: any) { } - - function foo13(x: I, Five>); - function foo13(x: typeof a); // ok - function foo13(x: any) { } - - function foo14(x: I, Five>); - function foo14(x: typeof b); // ok - function foo14(x: any) { } - - function foo15(x: I2); - function foo15(x: C); // ok - function foo15(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.symbols new file mode 100644 index 0000000000000..6bcbd98f225ef --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.symbols @@ -0,0 +1,497 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class One { foo: string } +>One : Symbol(One, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 0, 0)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 11)) + +class Two { foo: string } +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 11)) + +interface Three { foo: string } +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 6, 17)) + +interface Four { foo: T } +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 6, 31)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 15)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 15)) + +interface Five extends Four { } +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 8, 15)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 6, 31)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 8, 15)) + +interface Six { +>Six : Symbol(Six, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 8, 37)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 9, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 9, 16)) + + foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 9, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 9, 14)) +} + +class A { +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 11, 1)) + + foo(x: T, y: U): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 13, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 14, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 14, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 14, 20)) +>One : Symbol(One, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 0, 0)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 14, 36)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 14, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 14, 41)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 14, 20)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 15, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 17, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 17, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 17, 20)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) + + foo(x: T, y: U): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 17, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 18, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 17, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 18, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 17, 20)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 21, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 21, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 21, 20)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + + foo(x: T, y: U): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 21, 39)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 22, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 21, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 22, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 21, 20)) +} + +class D> { +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 23, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 25, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 25, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 25, 20)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 6, 31)) + + foo(x: T, y: U): string { return null; } +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 25, 46)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 26, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 25, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 26, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 25, 20)) +} + +interface I> { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 27, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 29, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 29, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 29, 24)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) + + foo(x: T, y: U): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 29, 50)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 30, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 29, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 30, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 29, 24)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 31, 1)) + + foo>(x: T, y: U): string; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 33, 14)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 34, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 34, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 34, 20)) +>Six : Symbol(Six, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 8, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 34, 52)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 34, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 34, 57)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 34, 20)) +} + +var a: { foo(x: T, y: U): string } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 25)) +>One : Symbol(One, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 0, 0)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 41)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 46)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 25)) + +var b = { foo(x: T, y: U) { return ''; } }; +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 3)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 26)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 26)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 42)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 47)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 26)) + +function foo1(x: A); +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 71), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 40, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 41, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 40, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 11, 1)) + +function foo1(x: A); // error +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 71), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 40, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 41, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 41, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 11, 1)) + +function foo1(x: any) { } +>foo1 : Symbol(foo1, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 71), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 40, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 41, 20)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 42, 14)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 42, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 44, 31), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 45, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 44, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 15, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 42, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 44, 31), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 45, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 45, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 15, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 42, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 44, 31), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 45, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 46, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 46, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 48, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 49, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 48, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 46, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 48, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 49, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 49, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 46, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 48, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 49, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 50, 15)) + +function foo2(x: I, Five>); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 50, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 52, 48), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 53, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 52, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 27, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo2(x: I, Five>); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 50, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 52, 48), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 53, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 53, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 27, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 50, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 52, 48), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 53, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 54, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 54, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 56, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 57, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 56, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 54, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 56, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 57, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 57, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 54, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 56, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 57, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 58, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 58, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 60, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 61, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 60, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 58, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 60, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 61, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 61, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 58, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 60, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 61, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 62, 14)) + +function foo5(x: A); +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 62, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 64, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 65, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 64, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 11, 1)) + +function foo5(x: B); // ok +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 62, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 64, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 65, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 65, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 15, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo5(x: any) { } +>foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 62, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 64, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 65, 30)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 66, 14)) + +function foo5b(x: A); +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 66, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 68, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 69, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 68, 15)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 11, 1)) + +function foo5b(x: C); // ok +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 66, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 68, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 69, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 69, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo5b(x: any) { } +>foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 66, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 68, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 69, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 70, 15)) + +function foo5c(x: C); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 70, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 72, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 73, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 72, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo5c(x: D, Four>); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 70, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 72, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 73, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 73, 15)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 23, 1)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 6, 31)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 6, 31)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 70, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 72, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 73, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 74, 15)) + +function foo6c(x: C); +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 74, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 76, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 77, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 76, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo6c(x: D, Four>); // error +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 74, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 76, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 77, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 77, 15)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 23, 1)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 6, 31)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 6, 31)) + +function foo6c(x: any) { } +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 74, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 76, 35), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 77, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 78, 15)) + +function foo6(x: A); +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 78, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 80, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 81, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 80, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 11, 1)) + +function foo6(x: I, Five>); // ok +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 78, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 80, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 81, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 81, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 27, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo6(x: any) { } +>foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 78, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 80, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 81, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 82, 14)) + +function foo7(x: A); +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 82, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 84, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 85, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 84, 14)) +>A : Symbol(A, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 11, 1)) + +function foo7(x: typeof a); // error +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 82, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 84, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 85, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 85, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 3)) + +function foo7(x: any) { } +>foo7 : Symbol(foo7, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 82, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 84, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 85, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 86, 14)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 86, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 88, 30), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 89, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 88, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 15, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo8(x: I, Five>); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 86, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 88, 30), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 89, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 89, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 27, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 86, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 88, 30), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 89, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 90, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 90, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 92, 30), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 93, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 92, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 15, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 90, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 92, 30), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 93, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 93, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 90, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 92, 30), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 93, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 94, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 94, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 96, 31), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 97, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 96, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 15, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 94, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 96, 31), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 97, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 97, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 94, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 96, 31), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 97, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 98, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 98, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 100, 31), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 101, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 100, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 15, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 98, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 100, 31), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 101, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 101, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 98, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 100, 31), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 101, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 102, 15)) + +function foo12(x: I, Five>); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 102, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 104, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 105, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 104, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 27, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo12(x: C); // error +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 102, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 104, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 105, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 105, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 102, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 104, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 105, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 106, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 106, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 108, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 109, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 108, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 31, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 106, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 108, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 109, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 109, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 106, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 108, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 109, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 110, 16)) + +function foo13(x: I, Five>); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 110, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 112, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 112, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 27, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 110, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 112, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 113, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 37, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 110, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 112, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 113, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 114, 15)) + +function foo14(x: I, Five>); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 114, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 116, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 117, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 116, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 27, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 114, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 116, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 117, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 117, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 38, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 114, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 116, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 117, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 118, 15)) + +function foo15(x: I2); +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 118, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 120, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 121, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 120, 15)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 31, 1)) + +function foo15(x: C); // ok +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 118, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 120, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 121, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 121, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 19, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo15(x: any) { } +>foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 118, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 120, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 121, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts, 122, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types new file mode 100644 index 0000000000000..b5c2f6bdef0e8 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.types @@ -0,0 +1,503 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints3.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class One { foo: string } +>One : One +>foo : string + +class Two { foo: string } +>Two : Two +>foo : string + +interface Three { foo: string } +>Three : Three +>foo : string + +interface Four { foo: T } +>Four : Four +>T : T +>foo : T +>T : T + +interface Five extends Four { } +>Five : Five +>T : T +>Four : Four +>T : T + +interface Six { +>Six : Six +>T : T +>U : U + + foo: T; +>foo : T +>T : T +} + +class A { +>A : A + + foo(x: T, y: U): string { return null; } +>foo : (x: T, y: U) => string +>T : T +>U : U +>U : U +>One : One +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class B { +>B : B +>T : T +>U : U +>U : U +>Two : Two + + foo(x: T, y: U): string { return null; } +>foo : (x: T, y: U) => string +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class C { +>C : C +>T : T +>U : U +>U : U +>Three : Three + + foo(x: T, y: U): string { return null; } +>foo : (x: T, y: U) => string +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class D> { +>D : D +>T : T +>U : U +>U : U +>Four : Four + + foo(x: T, y: U): string { return null; } +>foo : (x: T, y: U) => string +>x : T +>T : T +>y : U +>U : U +>null : null +} + +interface I> { +>I : I +>T : T +>U : U +>U : U +>Five : Five + + foo(x: T, y: U): string; +>foo : (x: T, y: U) => string +>x : T +>T : T +>y : U +>U : U +} + +interface I2 { +>I2 : I2 + + foo>(x: T, y: U): string; +>foo : >(x: T, y: U) => string +>T : T +>U : U +>U : U +>Six : Six +>x : T +>T : T +>y : U +>U : U +} + +var a: { foo(x: T, y: U): string } +>a : { foo(x: T, y: U): string; } +>foo : (x: T, y: U) => string +>T : T +>U : U +>U : U +>One : One +>x : T +>T : T +>y : U +>U : U + +var b = { foo(x: T, y: U) { return ''; } }; +>b : { foo(x: T, y: U): string; } +>{ foo(x: T, y: U) { return ''; } } : { foo(x: T, y: U): string; } +>foo : (x: T, y: U) => string +>T : T +>U : U +>U : U +>Two : Two +>x : T +>T : T +>y : U +>U : U +>'' : string + +function foo1(x: A); +>foo1 : { (x: A): any; (x: A): any; } +>x : A +>A : A + +function foo1(x: A); // error +>foo1 : { (x: A): any; (x: A): any; } +>x : A +>A : A + +function foo1(x: any) { } +>foo1 : { (x: A): any; (x: A): any; } +>x : any + +function foo1b(x: B); +>foo1b : { (x: B): any; (x: B): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo1b(x: B); // error +>foo1b : { (x: B): any; (x: B): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo1b(x: any) { } +>foo1b : { (x: B): any; (x: B): any; } +>x : any + +function foo1c(x: C); +>foo1c : { (x: C): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo1c(x: C); // error +>foo1c : { (x: C): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo1c(x: any) { } +>foo1c : { (x: C): any; (x: C): any; } +>x : any + +function foo2(x: I, Five>); +>foo2 : { (x: I, Five>): any; (x: I, Five>): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo2(x: I, Five>); // error +>foo2 : { (x: I, Five>): any; (x: I, Five>): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo2(x: any) { } +>foo2 : { (x: I, Five>): any; (x: I, Five>): any; } +>x : any + +function foo3(x: typeof a); +>foo3 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo3(x: typeof a); // error +>foo3 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo3(x: any) { } +>foo3 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo4(x: typeof b); +>foo4 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>b : { foo(x: T, y: U): string; } + +function foo4(x: typeof b); // error +>foo4 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>b : { foo(x: T, y: U): string; } + +function foo4(x: any) { } +>foo4 : { (x: { foo(x: T, y: U): string; }): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo5(x: A); +>foo5 : { (x: A): any; (x: B): any; } +>x : A +>A : A + +function foo5(x: B); // ok +>foo5 : { (x: A): any; (x: B): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo5(x: any) { } +>foo5 : { (x: A): any; (x: B): any; } +>x : any + +function foo5b(x: A); +>foo5b : { (x: A): any; (x: C): any; } +>x : A +>A : A + +function foo5b(x: C); // ok +>foo5b : { (x: A): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo5b(x: any) { } +>foo5b : { (x: A): any; (x: C): any; } +>x : any + +function foo5c(x: C); +>foo5c : { (x: C): any; (x: D, Four>): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo5c(x: D, Four>); // error +>foo5c : { (x: C): any; (x: D, Four>): any; } +>x : D, Four> +>D : D +>Four : Four +>Four : Four + +function foo5c(x: any) { } +>foo5c : { (x: C): any; (x: D, Four>): any; } +>x : any + +function foo6c(x: C); +>foo6c : { (x: C): any; (x: D, Four>): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo6c(x: D, Four>); // error +>foo6c : { (x: C): any; (x: D, Four>): any; } +>x : D, Four> +>D : D +>Four : Four +>Four : Four + +function foo6c(x: any) { } +>foo6c : { (x: C): any; (x: D, Four>): any; } +>x : any + +function foo6(x: A); +>foo6 : { (x: A): any; (x: I, Five>): any; } +>x : A +>A : A + +function foo6(x: I, Five>); // ok +>foo6 : { (x: A): any; (x: I, Five>): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo6(x: any) { } +>foo6 : { (x: A): any; (x: I, Five>): any; } +>x : any + +function foo7(x: A); +>foo7 : { (x: A): any; (x: { foo(x: T, y: U): string; }): any; } +>x : A +>A : A + +function foo7(x: typeof a); // error +>foo7 : { (x: A): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo7(x: any) { } +>foo7 : { (x: A): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo8(x: B); +>foo8 : { (x: B): any; (x: I, Five>): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo8(x: I, Five>); // error +>foo8 : { (x: B): any; (x: I, Five>): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo8(x: any) { } +>foo8 : { (x: B): any; (x: I, Five>): any; } +>x : any + +function foo9(x: B); +>foo9 : { (x: B): any; (x: C): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo9(x: C); // error +>foo9 : { (x: B): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo9(x: any) { } +>foo9 : { (x: B): any; (x: C): any; } +>x : any + +function foo10(x: B); +>foo10 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo10(x: typeof a); // ok +>foo10 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo10(x: any) { } +>foo10 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo11(x: B); +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo11(x: typeof b); // ok +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>b : { foo(x: T, y: U): string; } + +function foo11(x: any) { } +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo12(x: I, Five>); +>foo12 : { (x: I, Five>): any; (x: C): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo12(x: C); // error +>foo12 : { (x: I, Five>): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo12(x: any) { } +>foo12 : { (x: I, Five>): any; (x: C): any; } +>x : any + +function foo12b(x: I2); +>foo12b : { (x: I2): any; (x: C): any; } +>x : I2 +>I2 : I2 + +function foo12b(x: C); // ok +>foo12b : { (x: I2): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo12b(x: any) { } +>foo12b : { (x: I2): any; (x: C): any; } +>x : any + +function foo13(x: I, Five>); +>foo13 : { (x: I, Five>): any; (x: { foo(x: T, y: U): string; }): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo13(x: typeof a); // ok +>foo13 : { (x: I, Five>): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>a : { foo(x: T, y: U): string; } + +function foo13(x: any) { } +>foo13 : { (x: I, Five>): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo14(x: I, Five>); +>foo14 : { (x: I, Five>): any; (x: { foo(x: T, y: U): string; }): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo14(x: typeof b); // ok +>foo14 : { (x: I, Five>): any; (x: { foo(x: T, y: U): string; }): any; } +>x : { foo(x: T, y: U): string; } +>b : { foo(x: T, y: U): string; } + +function foo14(x: any) { } +>foo14 : { (x: I, Five>): any; (x: { foo(x: T, y: U): string; }): any; } +>x : any + +function foo15(x: I2); +>foo15 : { (x: I2): any; (x: C): any; } +>x : I2 +>I2 : I2 + +function foo15(x: C); // ok +>foo15 : { (x: I2): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo15(x: any) { } +>foo15 : { (x: I2): any; (x: C): any; } +>x : any + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt deleted file mode 100644 index 536be73b5cca4..0000000000000 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.errors.txt +++ /dev/null @@ -1,110 +0,0 @@ -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(5,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(9,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(13,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(17,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(22,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(25,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts(26,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts (7 errors) ==== - // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those - // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, - // optional or rest) and types, and identical return types. - - class B> { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - constructor(x: T, y: U) { return null; } - } - - class C { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - constructor(x: T, y: U) { return null; } - } - - class D { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - constructor(x: T, y: U) { return null; } - } - - interface I { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - new(x: T, y: U): string; - } - - interface I2 { - new(x: T, y: U): string; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - var a: { new>(x: T, y: U): string } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - function foo1b(x: B, Array>); - function foo1b(x: B, Array>); // error - function foo1b(x: any) { } - - function foo1c(x: C); - function foo1c(x: C); // error - function foo1c(x: any) { } - - function foo2(x: I); - function foo2(x: I); // error - function foo2(x: any) { } - - function foo3(x: typeof a); - function foo3(x: typeof a); // error - function foo3(x: any) { } - - function foo4(x: typeof b); - function foo4(x: typeof b); // error - function foo4(x: any) { } - - function foo5c(x: C); - function foo5c(x: D); // ok - function foo5c(x: any) { } - - function foo6c(x: C); - function foo6c(x: D); // ok - function foo6c(x: any) { } - - function foo8(x: B, Array>); - function foo8(x: I); // ok - function foo8(x: any) { } - - function foo9(x: B, Array>); - function foo9(x: C); // error, types are structurally equal - function foo9(x: any) { } - - function foo10(x: B, Array>); - function foo10(x: typeof a); // ok - function foo10(x: any) { } - - function foo11(x: B, Array>); - function foo11(x: typeof b); // ok - function foo11(x: any) { } - - function foo12(x: I); - function foo12(x: C); // ok - function foo12(x: any) { } - - function foo12b(x: I2); - function foo12b(x: C); // ok - function foo12b(x: any) { } - - function foo13(x: I); - function foo13(x: typeof a); // ok - function foo13(x: any) { } - - function foo14(x: I); - function foo14(x: typeof b); // ok - function foo14(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.symbols new file mode 100644 index 0000000000000..ce55a11462193 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.symbols @@ -0,0 +1,349 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B> { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 0, 0)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 4, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 4, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 4, 20)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + constructor(x: T, y: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 5, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 4, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 5, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 4, 20)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 6, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 8, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 8, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 8, 20)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + constructor(x: T, y: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 9, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 8, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 9, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 8, 20)) +} + +class D { +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 10, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 12, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 12, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 12, 20)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + constructor(x: T, y: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 13, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 12, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 13, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 12, 20)) +} + +interface I { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 14, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 16, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 16, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 16, 24)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + new(x: T, y: U): string; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 17, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 16, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 17, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 16, 24)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 18, 1)) + + new(x: T, y: U): string; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 21, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 21, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 21, 20)) +>Boolean : Symbol(Boolean, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 21, 40)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 21, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 21, 45)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 21, 20)) +} + +var a: { new>(x: T, y: U): string } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 25)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 51)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 56)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 25)) + +var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 26)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 26)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 45)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 50)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 26)) + +function foo1b(x: B, Array>); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 74), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 27, 51), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 28, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 27, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo1b(x: B, Array>); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 74), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 27, 51), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 28, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 28, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 74), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 27, 51), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 28, 51)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 29, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 31, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 31, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 31, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 32, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 31, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 32, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 33, 15)) + +function foo2(x: I); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 33, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 35, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 36, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 35, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo2(x: I); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 33, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 35, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 36, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 36, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 33, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 35, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 36, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 37, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 39, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 40, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 37, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 39, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 40, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 41, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 43, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 43, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 43, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 44, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 43, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 44, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 45, 14)) + +function foo5c(x: C); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 47, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 48, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 47, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo5c(x: D); // ok +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 47, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 48, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 48, 15)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 47, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 48, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 49, 15)) + +function foo6c(x: C); +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 49, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 52, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 51, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo6c(x: D); // ok +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 49, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 52, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 52, 15)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 10, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo6c(x: any) { } +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 49, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 51, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 52, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 53, 15)) + +function foo8(x: B, Array>); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 55, 50), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 56, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 55, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo8(x: I); // ok +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 55, 50), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 56, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 56, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 55, 50), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 56, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 57, 14)) + +function foo9(x: B, Array>); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 57, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 59, 50), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 59, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo9(x: C); // error, types are structurally equal +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 57, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 59, 50), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 60, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 57, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 59, 50), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 60, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 61, 14)) + +function foo10(x: B, Array>); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 61, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 63, 51), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 64, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 63, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 61, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 63, 51), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 64, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 64, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 61, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 63, 51), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 64, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 65, 15)) + +function foo11(x: B, Array>); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 65, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 67, 51), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 67, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 65, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 67, 51), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 68, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 65, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 67, 51), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 68, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 69, 15)) + +function foo12(x: I); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 72, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 71, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 72, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 72, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 71, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 72, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 73, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 75, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 76, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 75, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 18, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 75, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 76, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 76, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 6, 1)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 75, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 76, 38)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 77, 16)) + +function foo13(x: I); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 77, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 79, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 79, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 77, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 79, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 80, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 24, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 77, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 79, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 80, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 81, 15)) + +function foo14(x: I); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 81, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 83, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 84, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 83, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 14, 1)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 81, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 83, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 84, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 84, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 25, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 81, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 83, 37), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 84, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts, 85, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types new file mode 100644 index 0000000000000..b1d1d79ac0582 --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.types @@ -0,0 +1,354 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class B> { +>B : B +>T : T +>U : U +>U : U +>Array : T[] + + constructor(x: T, y: U) { return null; } +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class C { +>C : C +>T : T +>U : U +>U : U +>String : String + + constructor(x: T, y: U) { return null; } +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class D { +>D : D +>T : T +>U : U +>U : U +>Number : Number + + constructor(x: T, y: U) { return null; } +>x : T +>T : T +>y : U +>U : U +>null : null +} + +interface I { +>I : I +>T : T +>U : U +>U : U +>Number : Number + + new(x: T, y: U): string; +>x : T +>T : T +>y : U +>U : U +} + +interface I2 { +>I2 : I2 + + new(x: T, y: U): string; +>T : T +>U : U +>U : U +>Boolean : Boolean +>x : T +>T : T +>y : U +>U : U +} + +var a: { new>(x: T, y: U): string } +>a : new (x: T, y: U) => string +>T : T +>U : U +>U : U +>Array : T[] +>x : T +>T : T +>y : U +>U : U + +var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new +>b : { new(x: T, y: U): string; } +>{ new(x: T, y: U) { return ''; } } : { new(x: T, y: U): string; } +>new : (x: T, y: U) => string +>T : T +>U : U +>U : U +>RegExp : RegExp +>x : T +>T : T +>y : U +>U : U +>'' : string + +function foo1b(x: B, Array>); +>foo1b : { (x: B): any; (x: B): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo1b(x: B, Array>); // error +>foo1b : { (x: B): any; (x: B): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo1b(x: any) { } +>foo1b : { (x: B): any; (x: B): any; } +>x : any + +function foo1c(x: C); +>foo1c : { (x: C): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo1c(x: C); // error +>foo1c : { (x: C): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo1c(x: any) { } +>foo1c : { (x: C): any; (x: C): any; } +>x : any + +function foo2(x: I); +>foo2 : { (x: I): any; (x: I): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo2(x: I); // error +>foo2 : { (x: I): any; (x: I): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo2(x: any) { } +>foo2 : { (x: I): any; (x: I): any; } +>x : any + +function foo3(x: typeof a); +>foo3 : { (x: new (x: T, y: U) => string): any; (x: new (x: T, y: U) => string): any; } +>x : new (x: T, y: U) => string +>a : new (x: T, y: U) => string + +function foo3(x: typeof a); // error +>foo3 : { (x: new (x: T, y: U) => string): any; (x: new (x: T, y: U) => string): any; } +>x : new (x: T, y: U) => string +>a : new (x: T, y: U) => string + +function foo3(x: any) { } +>foo3 : { (x: new (x: T, y: U) => string): any; (x: new (x: T, y: U) => string): any; } +>x : any + +function foo4(x: typeof b); +>foo4 : { (x: { new(x: T, y: U): string; }): any; (x: { new(x: T, y: U): string; }): any; } +>x : { new(x: T, y: U): string; } +>b : { new(x: T, y: U): string; } + +function foo4(x: typeof b); // error +>foo4 : { (x: { new(x: T, y: U): string; }): any; (x: { new(x: T, y: U): string; }): any; } +>x : { new(x: T, y: U): string; } +>b : { new(x: T, y: U): string; } + +function foo4(x: any) { } +>foo4 : { (x: { new(x: T, y: U): string; }): any; (x: { new(x: T, y: U): string; }): any; } +>x : any + +function foo5c(x: C); +>foo5c : { (x: C): any; (x: D): any; } +>x : C +>C : C +>String : String +>String : String + +function foo5c(x: D); // ok +>foo5c : { (x: C): any; (x: D): any; } +>x : D +>D : D +>Number : Number +>Number : Number + +function foo5c(x: any) { } +>foo5c : { (x: C): any; (x: D): any; } +>x : any + +function foo6c(x: C); +>foo6c : { (x: C): any; (x: D): any; } +>x : C +>C : C +>String : String +>String : String + +function foo6c(x: D); // ok +>foo6c : { (x: C): any; (x: D): any; } +>x : D +>D : D +>Number : Number + +function foo6c(x: any) { } +>foo6c : { (x: C): any; (x: D): any; } +>x : any + +function foo8(x: B, Array>); +>foo8 : { (x: B): any; (x: I): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo8(x: I); // ok +>foo8 : { (x: B): any; (x: I): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo8(x: any) { } +>foo8 : { (x: B): any; (x: I): any; } +>x : any + +function foo9(x: B, Array>); +>foo9 : { (x: B): any; (x: C): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo9(x: C); // error, types are structurally equal +>foo9 : { (x: B): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo9(x: any) { } +>foo9 : { (x: B): any; (x: C): any; } +>x : any + +function foo10(x: B, Array>); +>foo10 : { (x: B): any; (x: new (x: T, y: U) => string): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo10(x: typeof a); // ok +>foo10 : { (x: B): any; (x: new (x: T, y: U) => string): any; } +>x : new (x: T, y: U) => string +>a : new (x: T, y: U) => string + +function foo10(x: any) { } +>foo10 : { (x: B): any; (x: new (x: T, y: U) => string): any; } +>x : any + +function foo11(x: B, Array>); +>foo11 : { (x: B): any; (x: { new(x: T, y: U): string; }): any; } +>x : B +>B : B +>Array : T[] +>Array : T[] + +function foo11(x: typeof b); // ok +>foo11 : { (x: B): any; (x: { new(x: T, y: U): string; }): any; } +>x : { new(x: T, y: U): string; } +>b : { new(x: T, y: U): string; } + +function foo11(x: any) { } +>foo11 : { (x: B): any; (x: { new(x: T, y: U): string; }): any; } +>x : any + +function foo12(x: I); +>foo12 : { (x: I): any; (x: C): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo12(x: C); // ok +>foo12 : { (x: I): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo12(x: any) { } +>foo12 : { (x: I): any; (x: C): any; } +>x : any + +function foo12b(x: I2); +>foo12b : { (x: I2): any; (x: C): any; } +>x : I2 +>I2 : I2 + +function foo12b(x: C); // ok +>foo12b : { (x: I2): any; (x: C): any; } +>x : C +>C : C +>String : String +>String : String + +function foo12b(x: any) { } +>foo12b : { (x: I2): any; (x: C): any; } +>x : any + +function foo13(x: I); +>foo13 : { (x: I): any; (x: new (x: T, y: U) => string): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo13(x: typeof a); // ok +>foo13 : { (x: I): any; (x: new (x: T, y: U) => string): any; } +>x : new (x: T, y: U) => string +>a : new (x: T, y: U) => string + +function foo13(x: any) { } +>foo13 : { (x: I): any; (x: new (x: T, y: U) => string): any; } +>x : any + +function foo14(x: I); +>foo14 : { (x: I): any; (x: { new(x: T, y: U): string; }): any; } +>x : I +>I : I +>Number : Number +>Number : Number + +function foo14(x: typeof b); // ok +>foo14 : { (x: I): any; (x: { new(x: T, y: U): string; }): any; } +>x : { new(x: T, y: U): string; } +>b : { new(x: T, y: U): string; } + +function foo14(x: any) { } +>foo14 : { (x: I): any; (x: { new(x: T, y: U): string; }): any; } +>x : any + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt deleted file mode 100644 index 33a62356d1cab..0000000000000 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.errors.txt +++ /dev/null @@ -1,119 +0,0 @@ -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(14,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(18,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(22,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(26,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(31,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(34,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts(35,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts (7 errors) ==== - // Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those - // parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, - // optional or rest) and types, and identical return types. - - class One { foo: string } - class Two { foo: string } - interface Three { foo: string } - interface Four { foo: T } - interface Five extends Four { } - interface Six { - foo: T; - } - - class B { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - constructor(x: T, y: U) { return null; } - } - - class C { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - constructor(x: T, y: U) { return null; } - } - - class D> { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - constructor(x: T, y: U) { return null; } - } - - interface I> { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - new(x: T, y: U): string; - } - - interface I2 { - new>(x: T, y: U): string; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - - var a: { new(x: T, y: U): string } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - function foo1b(x: B); - function foo1b(x: B); // error - function foo1b(x: any) { } - - function foo1c(x: C); - function foo1c(x: C); // error - function foo1c(x: any) { } - - function foo2(x: I, Five>); - function foo2(x: I, Five>); // error - function foo2(x: any) { } - - function foo3(x: typeof a); - function foo3(x: typeof a); // error - function foo3(x: any) { } - - function foo4(x: typeof b); - function foo4(x: typeof b); // error - function foo4(x: any) { } - - function foo5c(x: C); - function foo5c(x: D, Four>); // error - function foo5c(x: any) { } - - function foo6c(x: C); - function foo6c(x: D, Four>); // error - function foo6c(x: any) { } - - function foo8(x: B); - function foo8(x: I, Five>); // error - function foo8(x: any) { } - - function foo9(x: B); - function foo9(x: C); // error - function foo9(x: any) { } - - function foo10(x: B); - function foo10(x: typeof a); // ok - function foo10(x: any) { } - - function foo11(x: B); - function foo11(x: typeof b); // ok - function foo11(x: any) { } - - function foo12(x: I, Five>); - function foo12(x: C); // ok - function foo12(x: any) { } - - function foo12b(x: I2); - function foo12b(x: C); // ok - function foo12b(x: any) { } - - function foo13(x: I, Five>); - function foo13(x: typeof a); // ok - function foo13(x: any) { } - - function foo14(x: I, Five>); - function foo14(x: typeof b); // ok - function foo14(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.symbols new file mode 100644 index 0000000000000..4d7adc798f93a --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.symbols @@ -0,0 +1,384 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class One { foo: string } +>One : Symbol(One, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 0, 0)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 11)) + +class Two { foo: string } +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 11)) + +interface Three { foo: string } +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 6, 17)) + +interface Four { foo: T } +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 6, 31)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 15)) +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 19)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 15)) + +interface Five extends Four { } +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 8, 15)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 6, 31)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 8, 15)) + +interface Six { +>Six : Symbol(Six, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 8, 37)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 9, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 9, 16)) + + foo: T; +>foo : Symbol(foo, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 9, 21)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 9, 14)) +} + +class B { +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 11, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 13, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 13, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 13, 20)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) + + constructor(x: T, y: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 14, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 13, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 14, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 13, 20)) +} + +class C { +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 15, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 17, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 17, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 17, 20)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) + + constructor(x: T, y: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 18, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 17, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 18, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 17, 20)) +} + +class D> { +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 19, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 21, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 21, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 21, 20)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 6, 31)) + + constructor(x: T, y: U) { return null; } +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 22, 16)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 21, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 22, 21)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 21, 20)) +} + +interface I> { +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 23, 1)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 25, 12)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 25, 24)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 25, 24)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) + + new(x: T, y: U): string; +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 26, 8)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 25, 12)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 26, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 25, 24)) +} + +interface I2 { +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 27, 1)) + + new>(x: T, y: U): string; +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 30, 8)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 30, 20)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 30, 20)) +>Six : Symbol(Six, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 8, 37)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 30, 52)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 30, 8)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 30, 57)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 30, 20)) +} + +var a: { new(x: T, y: U): string } +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 3)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 13)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 25)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 25)) +>One : Symbol(One, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 0, 0)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 41)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 13)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 46)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 25)) + +var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 3)) +>new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 9)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 14)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 26)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 26)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 42)) +>T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 14)) +>y : Symbol(y, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 47)) +>U : Symbol(U, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 26)) + +function foo1b(x: B); +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 71), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 36, 31), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 37, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 36, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 11, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo1b(x: B); // error +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 71), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 36, 31), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 37, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 37, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 11, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo1b(x: any) { } +>foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 71), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 36, 31), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 37, 31)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 38, 15)) + +function foo1c(x: C); +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 38, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 40, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 41, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 40, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 15, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo1c(x: C); // error +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 38, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 40, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 41, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 41, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 15, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo1c(x: any) { } +>foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 38, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 40, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 41, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 42, 15)) + +function foo2(x: I, Five>); +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 42, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 44, 48), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 45, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 44, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 23, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo2(x: I, Five>); // error +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 42, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 44, 48), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 45, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 45, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 23, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo2(x: any) { } +>foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 42, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 44, 48), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 45, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 46, 14)) + +function foo3(x: typeof a); +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 46, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 48, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 48, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 3)) + +function foo3(x: typeof a); // error +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 46, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 48, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 49, 14)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 3)) + +function foo3(x: any) { } +>foo3 : Symbol(foo3, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 46, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 48, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 49, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 50, 14)) + +function foo4(x: typeof b); +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 50, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 52, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 52, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 3)) + +function foo4(x: typeof b); // error +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 50, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 52, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 53, 14)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 3)) + +function foo4(x: any) { } +>foo4 : Symbol(foo4, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 50, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 52, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 53, 27)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 54, 14)) + +function foo5c(x: C); +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 54, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 56, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 57, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 56, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 15, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo5c(x: D, Four>); // error +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 54, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 56, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 57, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 57, 15)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 19, 1)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 6, 31)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 6, 31)) + +function foo5c(x: any) { } +>foo5c : Symbol(foo5c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 54, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 56, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 57, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 58, 15)) + +function foo6c(x: C); +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 58, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 60, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 61, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 60, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 15, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo6c(x: D, Four>); // error +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 58, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 60, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 61, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 61, 15)) +>D : Symbol(D, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 19, 1)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 6, 31)) +>Four : Symbol(Four, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 6, 31)) + +function foo6c(x: any) { } +>foo6c : Symbol(foo6c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 58, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 60, 35), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 61, 49)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 62, 15)) + +function foo8(x: B); +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 62, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 64, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 65, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 64, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 11, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo8(x: I, Five>); // error +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 62, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 64, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 65, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 65, 14)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 23, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo8(x: any) { } +>foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 62, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 64, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 65, 48)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 66, 14)) + +function foo9(x: B); +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 66, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 68, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 69, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 68, 14)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 11, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo9(x: C); // error +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 66, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 68, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 69, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 69, 14)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 15, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo9(x: any) { } +>foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 66, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 68, 30), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 69, 34)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 70, 14)) + +function foo10(x: B); +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 70, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 72, 31), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 73, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 72, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 11, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo10(x: typeof a); // ok +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 70, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 72, 31), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 73, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 73, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 3)) + +function foo10(x: any) { } +>foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 70, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 72, 31), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 73, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 74, 15)) + +function foo11(x: B); +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 74, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 76, 31), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 77, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 76, 15)) +>B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 11, 1)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) +>Two : Symbol(Two, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 4, 25)) + +function foo11(x: typeof b); // ok +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 74, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 76, 31), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 77, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 77, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 3)) + +function foo11(x: any) { } +>foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 74, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 76, 31), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 77, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 78, 15)) + +function foo12(x: I, Five>); +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 78, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 80, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 81, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 80, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 23, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo12(x: C); // ok +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 78, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 80, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 81, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 81, 15)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 15, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo12(x: any) { } +>foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 78, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 80, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 81, 35)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 82, 15)) + +function foo12b(x: I2); +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 82, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 84, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 85, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 84, 16)) +>I2 : Symbol(I2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 27, 1)) + +function foo12b(x: C); // ok +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 82, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 84, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 85, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 85, 16)) +>C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 15, 1)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) +>Three : Symbol(Three, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 5, 25)) + +function foo12b(x: any) { } +>foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 82, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 84, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 85, 36)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 86, 16)) + +function foo13(x: I, Five>); +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 86, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 88, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 88, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 23, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo13(x: typeof a); // ok +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 86, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 88, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 89, 15)) +>a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 33, 3)) + +function foo13(x: any) { } +>foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 86, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 88, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 89, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 90, 15)) + +function foo14(x: I, Five>); +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 90, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 92, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 92, 15)) +>I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 23, 1)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) +>Five : Symbol(Five, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 7, 28)) + +function foo14(x: typeof b); // ok +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 90, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 92, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 93, 15)) +>b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 34, 3)) + +function foo14(x: any) { } +>foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 90, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 92, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 93, 28)) +>x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts, 94, 15)) + diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types new file mode 100644 index 0000000000000..d8109a6a826fa --- /dev/null +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.types @@ -0,0 +1,389 @@ +=== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.ts === +// Two call or construct signatures are considered identical when they have the same number of type parameters and, considering those +// parameters pairwise identical, have identical type parameter constraints, identical number of parameters with identical kind(required, +// optional or rest) and types, and identical return types. + +class One { foo: string } +>One : One +>foo : string + +class Two { foo: string } +>Two : Two +>foo : string + +interface Three { foo: string } +>Three : Three +>foo : string + +interface Four { foo: T } +>Four : Four +>T : T +>foo : T +>T : T + +interface Five extends Four { } +>Five : Five +>T : T +>Four : Four +>T : T + +interface Six { +>Six : Six +>T : T +>U : U + + foo: T; +>foo : T +>T : T +} + +class B { +>B : B +>T : T +>U : U +>U : U +>Two : Two + + constructor(x: T, y: U) { return null; } +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class C { +>C : C +>T : T +>U : U +>U : U +>Three : Three + + constructor(x: T, y: U) { return null; } +>x : T +>T : T +>y : U +>U : U +>null : null +} + +class D> { +>D : D +>T : T +>U : U +>U : U +>Four : Four + + constructor(x: T, y: U) { return null; } +>x : T +>T : T +>y : U +>U : U +>null : null +} + +interface I> { +>I : I +>T : T +>U : U +>U : U +>Five : Five + + new(x: T, y: U): string; +>x : T +>T : T +>y : U +>U : U +} + +interface I2 { +>I2 : I2 + + new>(x: T, y: U): string; +>T : T +>U : U +>U : U +>Six : Six +>x : T +>T : T +>y : U +>U : U +} + +var a: { new(x: T, y: U): string } +>a : new (x: T, y: U) => string +>T : T +>U : U +>U : U +>One : One +>x : T +>T : T +>y : U +>U : U + +var b = { new(x: T, y: U) { return ''; } }; // not a construct signature, function called new +>b : { new(x: T, y: U): string; } +>{ new(x: T, y: U) { return ''; } } : { new(x: T, y: U): string; } +>new : (x: T, y: U) => string +>T : T +>U : U +>U : U +>Two : Two +>x : T +>T : T +>y : U +>U : U +>'' : string + +function foo1b(x: B); +>foo1b : { (x: B): any; (x: B): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo1b(x: B); // error +>foo1b : { (x: B): any; (x: B): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo1b(x: any) { } +>foo1b : { (x: B): any; (x: B): any; } +>x : any + +function foo1c(x: C); +>foo1c : { (x: C): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo1c(x: C); // error +>foo1c : { (x: C): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo1c(x: any) { } +>foo1c : { (x: C): any; (x: C): any; } +>x : any + +function foo2(x: I, Five>); +>foo2 : { (x: I, Five>): any; (x: I, Five>): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo2(x: I, Five>); // error +>foo2 : { (x: I, Five>): any; (x: I, Five>): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo2(x: any) { } +>foo2 : { (x: I, Five>): any; (x: I, Five>): any; } +>x : any + +function foo3(x: typeof a); +>foo3 : { (x: new (x: T, y: U) => string): any; (x: new (x: T, y: U) => string): any; } +>x : new (x: T, y: U) => string +>a : new (x: T, y: U) => string + +function foo3(x: typeof a); // error +>foo3 : { (x: new (x: T, y: U) => string): any; (x: new (x: T, y: U) => string): any; } +>x : new (x: T, y: U) => string +>a : new (x: T, y: U) => string + +function foo3(x: any) { } +>foo3 : { (x: new (x: T, y: U) => string): any; (x: new (x: T, y: U) => string): any; } +>x : any + +function foo4(x: typeof b); +>foo4 : { (x: { new(x: T, y: U): string; }): any; (x: { new(x: T, y: U): string; }): any; } +>x : { new(x: T, y: U): string; } +>b : { new(x: T, y: U): string; } + +function foo4(x: typeof b); // error +>foo4 : { (x: { new(x: T, y: U): string; }): any; (x: { new(x: T, y: U): string; }): any; } +>x : { new(x: T, y: U): string; } +>b : { new(x: T, y: U): string; } + +function foo4(x: any) { } +>foo4 : { (x: { new(x: T, y: U): string; }): any; (x: { new(x: T, y: U): string; }): any; } +>x : any + +function foo5c(x: C); +>foo5c : { (x: C): any; (x: D, Four>): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo5c(x: D, Four>); // error +>foo5c : { (x: C): any; (x: D, Four>): any; } +>x : D, Four> +>D : D +>Four : Four +>Four : Four + +function foo5c(x: any) { } +>foo5c : { (x: C): any; (x: D, Four>): any; } +>x : any + +function foo6c(x: C); +>foo6c : { (x: C): any; (x: D, Four>): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo6c(x: D, Four>); // error +>foo6c : { (x: C): any; (x: D, Four>): any; } +>x : D, Four> +>D : D +>Four : Four +>Four : Four + +function foo6c(x: any) { } +>foo6c : { (x: C): any; (x: D, Four>): any; } +>x : any + +function foo8(x: B); +>foo8 : { (x: B): any; (x: I, Five>): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo8(x: I, Five>); // error +>foo8 : { (x: B): any; (x: I, Five>): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo8(x: any) { } +>foo8 : { (x: B): any; (x: I, Five>): any; } +>x : any + +function foo9(x: B); +>foo9 : { (x: B): any; (x: C): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo9(x: C); // error +>foo9 : { (x: B): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo9(x: any) { } +>foo9 : { (x: B): any; (x: C): any; } +>x : any + +function foo10(x: B); +>foo10 : { (x: B): any; (x: new (x: T, y: U) => string): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo10(x: typeof a); // ok +>foo10 : { (x: B): any; (x: new (x: T, y: U) => string): any; } +>x : new (x: T, y: U) => string +>a : new (x: T, y: U) => string + +function foo10(x: any) { } +>foo10 : { (x: B): any; (x: new (x: T, y: U) => string): any; } +>x : any + +function foo11(x: B); +>foo11 : { (x: B): any; (x: { new(x: T, y: U): string; }): any; } +>x : B +>B : B +>Two : Two +>Two : Two + +function foo11(x: typeof b); // ok +>foo11 : { (x: B): any; (x: { new(x: T, y: U): string; }): any; } +>x : { new(x: T, y: U): string; } +>b : { new(x: T, y: U): string; } + +function foo11(x: any) { } +>foo11 : { (x: B): any; (x: { new(x: T, y: U): string; }): any; } +>x : any + +function foo12(x: I, Five>); +>foo12 : { (x: I, Five>): any; (x: C): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo12(x: C); // ok +>foo12 : { (x: I, Five>): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo12(x: any) { } +>foo12 : { (x: I, Five>): any; (x: C): any; } +>x : any + +function foo12b(x: I2); +>foo12b : { (x: I2): any; (x: C): any; } +>x : I2 +>I2 : I2 + +function foo12b(x: C); // ok +>foo12b : { (x: I2): any; (x: C): any; } +>x : C +>C : C +>Three : Three +>Three : Three + +function foo12b(x: any) { } +>foo12b : { (x: I2): any; (x: C): any; } +>x : any + +function foo13(x: I, Five>); +>foo13 : { (x: I, Five>): any; (x: new (x: T, y: U) => string): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo13(x: typeof a); // ok +>foo13 : { (x: I, Five>): any; (x: new (x: T, y: U) => string): any; } +>x : new (x: T, y: U) => string +>a : new (x: T, y: U) => string + +function foo13(x: any) { } +>foo13 : { (x: I, Five>): any; (x: new (x: T, y: U) => string): any; } +>x : any + +function foo14(x: I, Five>); +>foo14 : { (x: I, Five>): any; (x: { new(x: T, y: U): string; }): any; } +>x : I, Five> +>I : I +>Five : Five +>Five : Five + +function foo14(x: typeof b); // ok +>foo14 : { (x: I, Five>): any; (x: { new(x: T, y: U): string; }): any; } +>x : { new(x: T, y: U): string; } +>b : { new(x: T, y: U): string; } + +function foo14(x: any) { } +>foo14 : { (x: I, Five>): any; (x: { new(x: T, y: U): string; }): any; } +>x : any + diff --git a/tests/baselines/reference/parserGenericConstraint2.errors.txt b/tests/baselines/reference/parserGenericConstraint2.errors.txt index a1548d81d9a66..00fe33457a5cb 100644 --- a/tests/baselines/reference/parserGenericConstraint2.errors.txt +++ b/tests/baselines/reference/parserGenericConstraint2.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint2.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint2.ts(1,19): error TS2304: Cannot find name 'List'. -==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint2.ts (1 errors) ==== class C > { - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~ !!! error TS2304: Cannot find name 'List'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserGenericConstraint3.errors.txt b/tests/baselines/reference/parserGenericConstraint3.errors.txt index 1dc7ea4e08076..e4e42d5b53b51 100644 --- a/tests/baselines/reference/parserGenericConstraint3.errors.txt +++ b/tests/baselines/reference/parserGenericConstraint3.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint3.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint3.ts(1,19): error TS2304: Cannot find name 'List'. -==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint3.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint3.ts (1 errors) ==== class C> { - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~ !!! error TS2304: Cannot find name 'List'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserGenericConstraint4.errors.txt b/tests/baselines/reference/parserGenericConstraint4.errors.txt index 3109bca9a2fb7..b42570593f7ed 100644 --- a/tests/baselines/reference/parserGenericConstraint4.errors.txt +++ b/tests/baselines/reference/parserGenericConstraint4.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint4.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint4.ts(1,19): error TS2304: Cannot find name 'List'. -==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint4.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint4.ts (1 errors) ==== class C > > { - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~ !!! error TS2304: Cannot find name 'List'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserGenericConstraint5.errors.txt b/tests/baselines/reference/parserGenericConstraint5.errors.txt index db8fea938b840..3479731ae13f1 100644 --- a/tests/baselines/reference/parserGenericConstraint5.errors.txt +++ b/tests/baselines/reference/parserGenericConstraint5.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint5.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint5.ts(1,19): error TS2304: Cannot find name 'List'. -==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint5.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint5.ts (1 errors) ==== class C> > { - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~ !!! error TS2304: Cannot find name 'List'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserGenericConstraint6.errors.txt b/tests/baselines/reference/parserGenericConstraint6.errors.txt index 032ed7fafb34c..5efbcc8e8d0ee 100644 --- a/tests/baselines/reference/parserGenericConstraint6.errors.txt +++ b/tests/baselines/reference/parserGenericConstraint6.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint6.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint6.ts(1,19): error TS2304: Cannot find name 'List'. -==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint6.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint6.ts (1 errors) ==== class C >> { - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~ !!! error TS2304: Cannot find name 'List'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserGenericConstraint7.errors.txt b/tests/baselines/reference/parserGenericConstraint7.errors.txt index 62dc8373e6392..ffff8ea2583fe 100644 --- a/tests/baselines/reference/parserGenericConstraint7.errors.txt +++ b/tests/baselines/reference/parserGenericConstraint7.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint7.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint7.ts(1,19): error TS2304: Cannot find name 'List'. -==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint7.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Generics/parserGenericConstraint7.ts (1 errors) ==== class C>> { - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~~~~ !!! error TS2304: Cannot find name 'List'. } \ No newline at end of file diff --git a/tests/baselines/reference/primitiveConstraints1.errors.txt b/tests/baselines/reference/primitiveConstraints1.errors.txt index 55d1f24f4ba8d..fb9591bfc3153 100644 --- a/tests/baselines/reference/primitiveConstraints1.errors.txt +++ b/tests/baselines/reference/primitiveConstraints1.errors.txt @@ -1,15 +1,15 @@ -tests/cases/compiler/primitiveConstraints1.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/primitiveConstraints1.ts(4,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/primitiveConstraints1.ts(2,6): error TS2344: Type 'string' does not satisfy the constraint 'number'. +tests/cases/compiler/primitiveConstraints1.ts(5,14): error TS2344: Type 'string' does not satisfy the constraint 'number'. ==== tests/cases/compiler/primitiveConstraints1.ts (2 errors) ==== function foo1(t: T, u: U) { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo1('hm', 1); // no error + ~~~~~~ +!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. function foo2(t: T, u: U) { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo2(1, 'hm'); // error + ~~~~~~ +!!! error TS2344: Type 'string' does not satisfy the constraint 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.errors.txt b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.errors.txt deleted file mode 100644 index 89d6c4dcf2b67..0000000000000 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.errors.txt +++ /dev/null @@ -1,77 +0,0 @@ -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts(13,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts(31,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts(39,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts(40,6): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts(42,14): error TS2339: Property 'foo' does not exist on type '{}'. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts(49,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts (6 errors) ==== - // generic types should behave as if they have properties of their constraint type - - class A { - foo(): string { return ''; } - } - - class B extends A { - bar(): string { - return ''; - } - } - - class C { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - f() { - var x: T; - // BUG 823818 - var a = x['foo'](); // should be string - return a + x.foo(); - } - - g(x: U) { - // BUG 823818 - var a = x['foo'](); // should be string - return a + x.foo(); - } - } - - var r1a = (new C()).f(); - var r1b = (new C()).g(new B()); - - interface I { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo: T; - } - var i: I; - var r2 = i.foo.foo(); - var r2b = i.foo['foo'](); - - var a: { - (): T; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - (x: U): U; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } - var r3 = a().foo(); // error, no inferences for U so it doesn't satisfy constraint - ~~~ -!!! error TS2339: Property 'foo' does not exist on type '{}'. - var r3b = a()['foo'](); - // parameter supplied for type argument inference for U - var r3c = a(new B()).foo(); // valid call to an invalid function, U is inferred as B, which has a foo - var r3d = a(new B())['foo'](); // valid call to an invalid function, U is inferred as B, which has a foo - - var b = { - foo: (x: T) => { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - // BUG 823818 - var a = x['foo'](); // should be string - return a + x.foo(); - } - } - - var r4 = b.foo(new B()); // valid call to an invalid function \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.symbols b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.symbols new file mode 100644 index 0000000000000..6d1074b14f67b --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.symbols @@ -0,0 +1,193 @@ +=== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts === +// generic types should behave as if they have properties of their constraint type + +class A { +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) + + foo(): string { return ''; } +>foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) +} + +class B extends A { +>B : Symbol(B, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 4, 1)) +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) + + bar(): string { +>bar : Symbol(bar, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 6, 19)) + + return ''; + } +} + +class C { +>C : Symbol(C, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 10, 1)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 12, 8)) +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 12, 20)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 12, 8)) + + f() { +>f : Symbol(f, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 12, 35)) + + var x: T; +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 14, 11)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 12, 20)) + + // BUG 823818 + var a = x['foo'](); // should be string +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 16, 11)) +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 14, 11)) +>'foo' : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + + return a + x.foo(); +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 16, 11)) +>x.foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 14, 11)) +>foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + } + + g(x: U) { +>g : Symbol(g, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 18, 5)) +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 20, 6)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 12, 8)) + + // BUG 823818 + var a = x['foo'](); // should be string +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 22, 11)) +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 20, 6)) +>'foo' : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + + return a + x.foo(); +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 22, 11)) +>x.foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 20, 6)) +>foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + } +} + +var r1a = (new C()).f(); +>r1a : Symbol(r1a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 27, 3)) +>(new C()).f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 12, 35)) +>C : Symbol(C, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 10, 1)) +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) +>B : Symbol(B, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 4, 1)) +>f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 12, 35)) + +var r1b = (new C()).g(new B()); +>r1b : Symbol(r1b, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 28, 3)) +>(new C()).g : Symbol(C.g, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 18, 5)) +>C : Symbol(C, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 10, 1)) +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) +>B : Symbol(B, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 4, 1)) +>g : Symbol(C.g, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 18, 5)) +>B : Symbol(B, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 4, 1)) + +interface I { +>I : Symbol(I, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 28, 37)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 30, 12)) +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 30, 24)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 30, 12)) + + foo: T; +>foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 30, 39)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 30, 24)) +} +var i: I; +>i : Symbol(i, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 33, 3)) +>I : Symbol(I, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 28, 37)) +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) +>B : Symbol(B, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 4, 1)) + +var r2 = i.foo.foo(); +>r2 : Symbol(r2, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 34, 3)) +>i.foo.foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) +>i.foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 30, 39)) +>i : Symbol(i, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 33, 3)) +>foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 30, 39)) +>foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + +var r2b = i.foo['foo'](); +>r2b : Symbol(r2b, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 35, 3)) +>i.foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 30, 39)) +>i : Symbol(i, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 33, 3)) +>foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 30, 39)) +>'foo' : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + +var a: { +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 37, 3)) + + (): T; +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 38, 5)) +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 38, 17)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 38, 5)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 38, 17)) + + (x: U): U; +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 39, 5)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 39, 17)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 39, 17)) +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 39, 31)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 39, 5)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 39, 5)) +} +var r3 = a().foo(); // error, no inferences for U so it doesn't satisfy constraint +>r3 : Symbol(r3, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 41, 3)) +>a().foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 37, 3)) +>foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + +var r3b = a()['foo'](); +>r3b : Symbol(r3b, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 42, 3)) +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 37, 3)) +>'foo' : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + +// parameter supplied for type argument inference for U +var r3c = a(new B()).foo(); // valid call to an invalid function, U is inferred as B, which has a foo +>r3c : Symbol(r3c, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 44, 3)) +>a(new B()).foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 37, 3)) +>B : Symbol(B, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 4, 1)) +>foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + +var r3d = a(new B())['foo'](); // valid call to an invalid function, U is inferred as B, which has a foo +>r3d : Symbol(r3d, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 45, 3)) +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 37, 3)) +>B : Symbol(B, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 4, 1)) +>'foo' : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + +var b = { +>b : Symbol(b, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 47, 3)) + + foo: (x: T) => { +>foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 47, 9)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 48, 10)) +>A : Symbol(A, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 0, 0)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 48, 22)) +>U : Symbol(U, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 48, 10)) +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 48, 36)) +>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 48, 22)) + + // BUG 823818 + var a = x['foo'](); // should be string +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 50, 11)) +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 48, 36)) +>'foo' : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + + return a + x.foo(); +>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 50, 11)) +>x.foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) +>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 48, 36)) +>foo : Symbol(A.foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 2, 9)) + } +} + +var r4 = b.foo(new B()); // valid call to an invalid function +>r4 : Symbol(r4, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 55, 3)) +>b.foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 47, 9)) +>b : Symbol(b, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 47, 3)) +>foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 47, 9)) +>B : Symbol(B, Decl(propertyAccessOnTypeParameterWithConstraints3.ts, 4, 1)) + diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types new file mode 100644 index 0000000000000..f2423f2bff8c2 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.types @@ -0,0 +1,233 @@ +=== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints3.ts === +// generic types should behave as if they have properties of their constraint type + +class A { +>A : A + + foo(): string { return ''; } +>foo : () => string +>'' : string +} + +class B extends A { +>B : B +>A : A + + bar(): string { +>bar : () => string + + return ''; +>'' : string + } +} + +class C { +>C : C +>U : U +>A : A +>T : T +>U : U + + f() { +>f : () => string + + var x: T; +>x : T +>T : T + + // BUG 823818 + var a = x['foo'](); // should be string +>a : string +>x['foo']() : string +>x['foo'] : () => string +>x : T +>'foo' : string + + return a + x.foo(); +>a + x.foo() : string +>a : string +>x.foo() : string +>x.foo : () => string +>x : T +>foo : () => string + } + + g(x: U) { +>g : (x: U) => string +>x : U +>U : U + + // BUG 823818 + var a = x['foo'](); // should be string +>a : string +>x['foo']() : string +>x['foo'] : () => string +>x : U +>'foo' : string + + return a + x.foo(); +>a + x.foo() : string +>a : string +>x.foo() : string +>x.foo : () => string +>x : U +>foo : () => string + } +} + +var r1a = (new C()).f(); +>r1a : string +>(new C()).f() : string +>(new C()).f : () => string +>(new C()) : C +>new C() : C +>C : typeof C +>A : A +>B : B +>f : () => string + +var r1b = (new C()).g(new B()); +>r1b : string +>(new C()).g(new B()) : string +>(new C()).g : (x: A) => string +>(new C()) : C +>new C() : C +>C : typeof C +>A : A +>B : B +>g : (x: A) => string +>new B() : B +>B : typeof B + +interface I { +>I : I +>U : U +>A : A +>T : T +>U : U + + foo: T; +>foo : T +>T : T +} +var i: I; +>i : I +>I : I +>A : A +>B : B + +var r2 = i.foo.foo(); +>r2 : string +>i.foo.foo() : string +>i.foo.foo : () => string +>i.foo : B +>i : I +>foo : B +>foo : () => string + +var r2b = i.foo['foo'](); +>r2b : string +>i.foo['foo']() : string +>i.foo['foo'] : () => string +>i.foo : B +>i : I +>foo : B +>'foo' : string + +var a: { +>a : { (): T; (x: U): U; } + + (): T; +>U : U +>A : A +>T : T +>U : U +>T : T + + (x: U): U; +>U : U +>T : T +>T : T +>A : A +>x : U +>U : U +>U : U +} +var r3 = a().foo(); // error, no inferences for U so it doesn't satisfy constraint +>r3 : string +>a().foo() : string +>a().foo : () => string +>a() : A +>a : { (): T; (x: U): U; } +>foo : () => string + +var r3b = a()['foo'](); +>r3b : string +>a()['foo']() : string +>a()['foo'] : () => string +>a() : A +>a : { (): T; (x: U): U; } +>'foo' : string + +// parameter supplied for type argument inference for U +var r3c = a(new B()).foo(); // valid call to an invalid function, U is inferred as B, which has a foo +>r3c : string +>a(new B()).foo() : string +>a(new B()).foo : () => string +>a(new B()) : B +>a : { (): T; (x: U): U; } +>new B() : B +>B : typeof B +>foo : () => string + +var r3d = a(new B())['foo'](); // valid call to an invalid function, U is inferred as B, which has a foo +>r3d : string +>a(new B())['foo']() : string +>a(new B())['foo'] : () => string +>a(new B()) : B +>a : { (): T; (x: U): U; } +>new B() : B +>B : typeof B +>'foo' : string + +var b = { +>b : { foo: (x: T) => string; } +>{ foo: (x: T) => { // BUG 823818 var a = x['foo'](); // should be string return a + x.foo(); }} : { foo: (x: T) => string; } + + foo: (x: T) => { +>foo : (x: T) => string +>(x: T) => { // BUG 823818 var a = x['foo'](); // should be string return a + x.foo(); } : (x: T) => string +>U : U +>A : A +>T : T +>U : U +>x : T +>T : T + + // BUG 823818 + var a = x['foo'](); // should be string +>a : string +>x['foo']() : string +>x['foo'] : () => string +>x : T +>'foo' : string + + return a + x.foo(); +>a + x.foo() : string +>a : string +>x.foo() : string +>x.foo : () => string +>x : T +>foo : () => string + } +} + +var r4 = b.foo(new B()); // valid call to an invalid function +>r4 : string +>b.foo(new B()) : string +>b.foo : (x: T) => string +>b : { foo: (x: T) => string; } +>foo : (x: T) => string +>new B() : B +>B : typeof B + diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.errors.txt b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.errors.txt index bf45f90564b28..fd012d0e5a542 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.errors.txt +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.errors.txt @@ -1,12 +1,11 @@ -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(11,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(21,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(15,32): error TS2339: Property 'notHere' does not exist on type 'U'. tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(25,16): error TS2339: Property 'notHere' does not exist on type 'B'. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(29,6): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(32,22): error TS2339: Property 'notHere' does not exist on type '{}'. -tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(36,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(32,22): error TS2339: Property 'notHere' does not exist on type 'A'. +tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(38,16): error TS2322: Type 'string' is not assignable to type 'U'. +tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts(38,22): error TS2339: Property 'notHere' does not exist on type 'U'. -==== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts (6 errors) ==== +==== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithConstraints5.ts (5 errors) ==== class A { foo(): string { return ''; } } @@ -18,20 +17,18 @@ tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOn } class C { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. f() { var x: U; var a = x['foo'](); // should be string return a + x.foo() + x.notHere(); + ~~~~~~~ +!!! error TS2339: Property 'notHere' does not exist on type 'U'. } } var r = (new C()).f(); interface I { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo: U; } var i: I; @@ -42,21 +39,21 @@ tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOn var a: { (): U; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. } // BUG 794164 var r3: string = a().notHere(); ~~~~~~~ -!!! error TS2339: Property 'notHere' does not exist on type '{}'. +!!! error TS2339: Property 'notHere' does not exist on type 'A'. var r3b: string = a()['foo'](); var b = { foo: (x: U): U => { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var a = x['foo'](); // should be string return a + x.notHere(); + ~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'U'. + ~~~~~~~ +!!! error TS2339: Property 'notHere' does not exist on type 'U'. }, // BUG 794164 bar: b.foo(1).notHere() diff --git a/tests/baselines/reference/recursiveGenericTypeHierarchy.errors.txt b/tests/baselines/reference/recursiveGenericTypeHierarchy.errors.txt deleted file mode 100644 index 3c1e6e2017c8c..0000000000000 --- a/tests/baselines/reference/recursiveGenericTypeHierarchy.errors.txt +++ /dev/null @@ -1,18 +0,0 @@ -tests/cases/compiler/recursiveGenericTypeHierarchy.ts(2,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/recursiveGenericTypeHierarchy.ts(2,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/recursiveGenericTypeHierarchy.ts(3,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/recursiveGenericTypeHierarchy.ts(3,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/recursiveGenericTypeHierarchy.ts (4 errors) ==== - // used to ICE - interface A, S extends A> { } - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - interface B, S extends B> extends A, B> { } - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file diff --git a/tests/baselines/reference/recursiveGenericTypeHierarchy.symbols b/tests/baselines/reference/recursiveGenericTypeHierarchy.symbols new file mode 100644 index 0000000000000..c46174c1e045e --- /dev/null +++ b/tests/baselines/reference/recursiveGenericTypeHierarchy.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/recursiveGenericTypeHierarchy.ts === +// used to ICE +interface A, S extends A> { } +>A : Symbol(A, Decl(recursiveGenericTypeHierarchy.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveGenericTypeHierarchy.ts, 1, 12)) +>A : Symbol(A, Decl(recursiveGenericTypeHierarchy.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveGenericTypeHierarchy.ts, 1, 12)) +>S : Symbol(S, Decl(recursiveGenericTypeHierarchy.ts, 1, 30)) +>S : Symbol(S, Decl(recursiveGenericTypeHierarchy.ts, 1, 30)) +>A : Symbol(A, Decl(recursiveGenericTypeHierarchy.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveGenericTypeHierarchy.ts, 1, 12)) +>S : Symbol(S, Decl(recursiveGenericTypeHierarchy.ts, 1, 30)) + +interface B, S extends B> extends A, B> { } +>B : Symbol(B, Decl(recursiveGenericTypeHierarchy.ts, 1, 53)) +>T : Symbol(T, Decl(recursiveGenericTypeHierarchy.ts, 2, 12)) +>B : Symbol(B, Decl(recursiveGenericTypeHierarchy.ts, 1, 53)) +>T : Symbol(T, Decl(recursiveGenericTypeHierarchy.ts, 2, 12)) +>S : Symbol(S, Decl(recursiveGenericTypeHierarchy.ts, 2, 30)) +>S : Symbol(S, Decl(recursiveGenericTypeHierarchy.ts, 2, 30)) +>B : Symbol(B, Decl(recursiveGenericTypeHierarchy.ts, 1, 53)) +>T : Symbol(T, Decl(recursiveGenericTypeHierarchy.ts, 2, 12)) +>S : Symbol(S, Decl(recursiveGenericTypeHierarchy.ts, 2, 30)) +>A : Symbol(A, Decl(recursiveGenericTypeHierarchy.ts, 0, 0)) +>B : Symbol(B, Decl(recursiveGenericTypeHierarchy.ts, 1, 53)) +>T : Symbol(T, Decl(recursiveGenericTypeHierarchy.ts, 2, 12)) +>S : Symbol(S, Decl(recursiveGenericTypeHierarchy.ts, 2, 30)) +>B : Symbol(B, Decl(recursiveGenericTypeHierarchy.ts, 1, 53)) +>T : Symbol(T, Decl(recursiveGenericTypeHierarchy.ts, 2, 12)) +>S : Symbol(S, Decl(recursiveGenericTypeHierarchy.ts, 2, 30)) + diff --git a/tests/baselines/reference/recursiveGenericTypeHierarchy.types b/tests/baselines/reference/recursiveGenericTypeHierarchy.types new file mode 100644 index 0000000000000..72936b9329950 --- /dev/null +++ b/tests/baselines/reference/recursiveGenericTypeHierarchy.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/recursiveGenericTypeHierarchy.ts === +// used to ICE +interface A, S extends A> { } +>A : A +>T : T +>A : A +>T : T +>S : S +>S : S +>A : A +>T : T +>S : S + +interface B, S extends B> extends A, B> { } +>B : B +>T : T +>B : B +>T : T +>S : S +>S : S +>B : B +>T : T +>S : S +>A : A +>B : B +>T : T +>S : S +>B : B +>T : T +>S : S + diff --git a/tests/baselines/reference/recursiveIdenticalAssignment.errors.txt b/tests/baselines/reference/recursiveIdenticalAssignment.errors.txt deleted file mode 100644 index e33515f93787f..0000000000000 --- a/tests/baselines/reference/recursiveIdenticalAssignment.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/compiler/recursiveIdenticalAssignment.ts(5,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/recursiveIdenticalAssignment.ts (1 errors) ==== - interface A { - x: A - } - - interface B>> { // error, constraint referencing itself - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - x: B - } - - var a: A> - var b: B> = a // Error, any does not satisfy constraint B> - \ No newline at end of file diff --git a/tests/baselines/reference/recursiveIdenticalAssignment.symbols b/tests/baselines/reference/recursiveIdenticalAssignment.symbols new file mode 100644 index 0000000000000..b82fe1d9d17ef --- /dev/null +++ b/tests/baselines/reference/recursiveIdenticalAssignment.symbols @@ -0,0 +1,35 @@ +=== tests/cases/compiler/recursiveIdenticalAssignment.ts === +interface A { +>A : Symbol(A, Decl(recursiveIdenticalAssignment.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveIdenticalAssignment.ts, 0, 12)) + + x: A +>x : Symbol(x, Decl(recursiveIdenticalAssignment.ts, 0, 16)) +>A : Symbol(A, Decl(recursiveIdenticalAssignment.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveIdenticalAssignment.ts, 0, 12)) +} + +interface B>> { // error, constraint referencing itself +>B : Symbol(B, Decl(recursiveIdenticalAssignment.ts, 2, 1)) +>T : Symbol(T, Decl(recursiveIdenticalAssignment.ts, 4, 12)) +>B : Symbol(B, Decl(recursiveIdenticalAssignment.ts, 2, 1)) +>B : Symbol(B, Decl(recursiveIdenticalAssignment.ts, 2, 1)) +>T : Symbol(T, Decl(recursiveIdenticalAssignment.ts, 4, 12)) + + x: B +>x : Symbol(x, Decl(recursiveIdenticalAssignment.ts, 4, 32)) +>B : Symbol(B, Decl(recursiveIdenticalAssignment.ts, 2, 1)) +>T : Symbol(T, Decl(recursiveIdenticalAssignment.ts, 4, 12)) +} + +var a: A> +>a : Symbol(a, Decl(recursiveIdenticalAssignment.ts, 8, 3)) +>A : Symbol(A, Decl(recursiveIdenticalAssignment.ts, 0, 0)) +>A : Symbol(A, Decl(recursiveIdenticalAssignment.ts, 0, 0)) + +var b: B> = a // Error, any does not satisfy constraint B> +>b : Symbol(b, Decl(recursiveIdenticalAssignment.ts, 9, 3)) +>B : Symbol(B, Decl(recursiveIdenticalAssignment.ts, 2, 1)) +>B : Symbol(B, Decl(recursiveIdenticalAssignment.ts, 2, 1)) +>a : Symbol(a, Decl(recursiveIdenticalAssignment.ts, 8, 3)) + diff --git a/tests/baselines/reference/recursiveIdenticalAssignment.types b/tests/baselines/reference/recursiveIdenticalAssignment.types new file mode 100644 index 0000000000000..aa7bf70bb0073 --- /dev/null +++ b/tests/baselines/reference/recursiveIdenticalAssignment.types @@ -0,0 +1,35 @@ +=== tests/cases/compiler/recursiveIdenticalAssignment.ts === +interface A { +>A : A +>T : T + + x: A +>x : A +>A : A +>T : T +} + +interface B>> { // error, constraint referencing itself +>B : B +>T : T +>B : B +>B : B +>T : T + + x: B +>x : B +>B : B +>T : T +} + +var a: A> +>a : A> +>A : A +>A : A + +var b: B> = a // Error, any does not satisfy constraint B> +>b : B> +>B : B +>B : B +>a : A> + diff --git a/tests/baselines/reference/recursiveTypeInGenericConstraint.errors.txt b/tests/baselines/reference/recursiveTypeInGenericConstraint.errors.txt deleted file mode 100644 index c3cf72273084f..0000000000000 --- a/tests/baselines/reference/recursiveTypeInGenericConstraint.errors.txt +++ /dev/null @@ -1,19 +0,0 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.ts(5,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.ts (1 errors) ==== - class G { - x: G>; // infinitely expanding type reference - } - - class Foo> { // error, constraint referencing itself - ~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - bar: T; - } - - class D { - x: G>; - } - - var c1 = new Foo>(); // ok, circularity in assignment compat check causes success \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypeInGenericConstraint.symbols b/tests/baselines/reference/recursiveTypeInGenericConstraint.symbols new file mode 100644 index 0000000000000..d23245e2187e4 --- /dev/null +++ b/tests/baselines/reference/recursiveTypeInGenericConstraint.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.ts === +class G { +>G : Symbol(G, Decl(recursiveTypeInGenericConstraint.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypeInGenericConstraint.ts, 0, 8)) + + x: G>; // infinitely expanding type reference +>x : Symbol(x, Decl(recursiveTypeInGenericConstraint.ts, 0, 12)) +>G : Symbol(G, Decl(recursiveTypeInGenericConstraint.ts, 0, 0)) +>G : Symbol(G, Decl(recursiveTypeInGenericConstraint.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypeInGenericConstraint.ts, 0, 8)) +} + +class Foo> { // error, constraint referencing itself +>Foo : Symbol(Foo, Decl(recursiveTypeInGenericConstraint.ts, 2, 1)) +>T : Symbol(T, Decl(recursiveTypeInGenericConstraint.ts, 4, 10)) +>G : Symbol(G, Decl(recursiveTypeInGenericConstraint.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypeInGenericConstraint.ts, 4, 10)) + + bar: T; +>bar : Symbol(bar, Decl(recursiveTypeInGenericConstraint.ts, 4, 27)) +>T : Symbol(T, Decl(recursiveTypeInGenericConstraint.ts, 4, 10)) +} + +class D { +>D : Symbol(D, Decl(recursiveTypeInGenericConstraint.ts, 6, 1)) +>T : Symbol(T, Decl(recursiveTypeInGenericConstraint.ts, 8, 8)) + + x: G>; +>x : Symbol(x, Decl(recursiveTypeInGenericConstraint.ts, 8, 12)) +>G : Symbol(G, Decl(recursiveTypeInGenericConstraint.ts, 0, 0)) +>G : Symbol(G, Decl(recursiveTypeInGenericConstraint.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypeInGenericConstraint.ts, 8, 8)) +} + +var c1 = new Foo>(); // ok, circularity in assignment compat check causes success +>c1 : Symbol(c1, Decl(recursiveTypeInGenericConstraint.ts, 12, 3)) +>Foo : Symbol(Foo, Decl(recursiveTypeInGenericConstraint.ts, 2, 1)) +>D : Symbol(D, Decl(recursiveTypeInGenericConstraint.ts, 6, 1)) + diff --git a/tests/baselines/reference/recursiveTypeInGenericConstraint.types b/tests/baselines/reference/recursiveTypeInGenericConstraint.types new file mode 100644 index 0000000000000..97f48aa64e54f --- /dev/null +++ b/tests/baselines/reference/recursiveTypeInGenericConstraint.types @@ -0,0 +1,40 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypeInGenericConstraint.ts === +class G { +>G : G +>T : T + + x: G>; // infinitely expanding type reference +>x : G> +>G : G +>G : G +>T : T +} + +class Foo> { // error, constraint referencing itself +>Foo : Foo +>T : T +>G : G +>T : T + + bar: T; +>bar : T +>T : T +} + +class D { +>D : D +>T : T + + x: G>; +>x : G> +>G : G +>G : G +>T : T +} + +var c1 = new Foo>(); // ok, circularity in assignment compat check causes success +>c1 : Foo> +>new Foo>() : Foo> +>Foo : typeof Foo +>D : D + diff --git a/tests/baselines/reference/recursiveTypes1.errors.txt b/tests/baselines/reference/recursiveTypes1.errors.txt deleted file mode 100644 index 62d4938ef1e00..0000000000000 --- a/tests/baselines/reference/recursiveTypes1.errors.txt +++ /dev/null @@ -1,22 +0,0 @@ -tests/cases/compiler/recursiveTypes1.ts(1,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/recursiveTypes1.ts(6,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/recursiveTypes1.ts (2 errors) ==== - interface Entity> { - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - X: T; - Y: T; - } - - interface Person> extends Entity { - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - n: number; - } - - interface Customer extends Person { - s: string; - } - \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypes1.symbols b/tests/baselines/reference/recursiveTypes1.symbols new file mode 100644 index 0000000000000..8ced51db0dc8f --- /dev/null +++ b/tests/baselines/reference/recursiveTypes1.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/recursiveTypes1.ts === +interface Entity> { +>Entity : Symbol(Entity, Decl(recursiveTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypes1.ts, 0, 17)) +>Entity : Symbol(Entity, Decl(recursiveTypes1.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypes1.ts, 0, 17)) + + X: T; +>X : Symbol(X, Decl(recursiveTypes1.ts, 0, 39)) +>T : Symbol(T, Decl(recursiveTypes1.ts, 0, 17)) + + Y: T; +>Y : Symbol(Y, Decl(recursiveTypes1.ts, 1, 8)) +>T : Symbol(T, Decl(recursiveTypes1.ts, 0, 17)) +} + +interface Person> extends Entity { +>Person : Symbol(Person, Decl(recursiveTypes1.ts, 3, 1)) +>U : Symbol(U, Decl(recursiveTypes1.ts, 5, 17)) +>Person : Symbol(Person, Decl(recursiveTypes1.ts, 3, 1)) +>U : Symbol(U, Decl(recursiveTypes1.ts, 5, 17)) +>Entity : Symbol(Entity, Decl(recursiveTypes1.ts, 0, 0)) +>U : Symbol(U, Decl(recursiveTypes1.ts, 5, 17)) + + n: number; +>n : Symbol(n, Decl(recursiveTypes1.ts, 5, 57)) +} + +interface Customer extends Person { +>Customer : Symbol(Customer, Decl(recursiveTypes1.ts, 7, 1)) +>Person : Symbol(Person, Decl(recursiveTypes1.ts, 3, 1)) +>Customer : Symbol(Customer, Decl(recursiveTypes1.ts, 7, 1)) + + s: string; +>s : Symbol(s, Decl(recursiveTypes1.ts, 9, 45)) +} + diff --git a/tests/baselines/reference/recursiveTypes1.types b/tests/baselines/reference/recursiveTypes1.types new file mode 100644 index 0000000000000..803c965e47135 --- /dev/null +++ b/tests/baselines/reference/recursiveTypes1.types @@ -0,0 +1,37 @@ +=== tests/cases/compiler/recursiveTypes1.ts === +interface Entity> { +>Entity : Entity +>T : T +>Entity : Entity +>T : T + + X: T; +>X : T +>T : T + + Y: T; +>Y : T +>T : T +} + +interface Person> extends Entity { +>Person : Person +>U : U +>Person : Person +>U : U +>Entity : Entity +>U : U + + n: number; +>n : number +} + +interface Customer extends Person { +>Customer : Customer +>Person : Person +>Customer : Customer + + s: string; +>s : string +} + diff --git a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.errors.txt b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.errors.txt deleted file mode 100644 index 577debaed4e62..0000000000000 --- a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.errors.txt +++ /dev/null @@ -1,49 +0,0 @@ -tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.ts(21,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.ts (1 errors) ==== - class List { - data: T; - next: List>; - } - - class MyList { - data: T; - next: MyList>; - } - - function foo(x: List); - function foo(x: List); // error, duplicate - function foo(x: List) { - } - - function foo2(x: List); - function foo2(x: MyList); // ok, nominally compared with first overload - function foo2(x: any) { - } - - function other, U>() { - ~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - // error but wrong error - // BUG 838247 - function foo3(x: T); - function foo3(x: MyList) { } - - // should be error - // BUG 838247 - function foo4(x: T); - function foo4(x: List) { } - - // ok - function foo5(x: T): string; - function foo5(x: List): number; - function foo5(x: MyList): boolean; - function foo5(x: any): any { return null; } - - var list: List; - var myList: MyList; - - var r = foo5(list); - var r2 = foo5(myList); - } \ No newline at end of file diff --git a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.symbols b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.symbols new file mode 100644 index 0000000000000..9894c6acd45dd --- /dev/null +++ b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.symbols @@ -0,0 +1,154 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.ts === +class List { +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 11)) + + data: T; +>data : Symbol(data, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 15)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 11)) + + next: List>; +>next : Symbol(next, Decl(recursiveTypesUsedAsFunctionParameters.ts, 1, 12)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 11)) +} + +class MyList { +>MyList : Symbol(MyList, Decl(recursiveTypesUsedAsFunctionParameters.ts, 3, 1)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 5, 13)) + + data: T; +>data : Symbol(data, Decl(recursiveTypesUsedAsFunctionParameters.ts, 5, 17)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 5, 13)) + + next: MyList>; +>next : Symbol(next, Decl(recursiveTypesUsedAsFunctionParameters.ts, 6, 12)) +>MyList : Symbol(MyList, Decl(recursiveTypesUsedAsFunctionParameters.ts, 3, 1)) +>MyList : Symbol(MyList, Decl(recursiveTypesUsedAsFunctionParameters.ts, 3, 1)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 5, 13)) +} + +function foo(x: List); +>foo : Symbol(foo, Decl(recursiveTypesUsedAsFunctionParameters.ts, 8, 1), Decl(recursiveTypesUsedAsFunctionParameters.ts, 10, 28), Decl(recursiveTypesUsedAsFunctionParameters.ts, 11, 28)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 10, 13)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 10, 16)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 10, 13)) + +function foo(x: List); // error, duplicate +>foo : Symbol(foo, Decl(recursiveTypesUsedAsFunctionParameters.ts, 8, 1), Decl(recursiveTypesUsedAsFunctionParameters.ts, 10, 28), Decl(recursiveTypesUsedAsFunctionParameters.ts, 11, 28)) +>U : Symbol(U, Decl(recursiveTypesUsedAsFunctionParameters.ts, 11, 13)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 11, 16)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>U : Symbol(U, Decl(recursiveTypesUsedAsFunctionParameters.ts, 11, 13)) + +function foo(x: List) { +>foo : Symbol(foo, Decl(recursiveTypesUsedAsFunctionParameters.ts, 8, 1), Decl(recursiveTypesUsedAsFunctionParameters.ts, 10, 28), Decl(recursiveTypesUsedAsFunctionParameters.ts, 11, 28)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 12, 13)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 12, 16)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 12, 13)) +} + +function foo2(x: List); +>foo2 : Symbol(foo2, Decl(recursiveTypesUsedAsFunctionParameters.ts, 13, 1), Decl(recursiveTypesUsedAsFunctionParameters.ts, 15, 29), Decl(recursiveTypesUsedAsFunctionParameters.ts, 16, 31)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 15, 14)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 15, 17)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 15, 14)) + +function foo2(x: MyList); // ok, nominally compared with first overload +>foo2 : Symbol(foo2, Decl(recursiveTypesUsedAsFunctionParameters.ts, 13, 1), Decl(recursiveTypesUsedAsFunctionParameters.ts, 15, 29), Decl(recursiveTypesUsedAsFunctionParameters.ts, 16, 31)) +>U : Symbol(U, Decl(recursiveTypesUsedAsFunctionParameters.ts, 16, 14)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 16, 17)) +>MyList : Symbol(MyList, Decl(recursiveTypesUsedAsFunctionParameters.ts, 3, 1)) +>U : Symbol(U, Decl(recursiveTypesUsedAsFunctionParameters.ts, 16, 14)) + +function foo2(x: any) { +>foo2 : Symbol(foo2, Decl(recursiveTypesUsedAsFunctionParameters.ts, 13, 1), Decl(recursiveTypesUsedAsFunctionParameters.ts, 15, 29), Decl(recursiveTypesUsedAsFunctionParameters.ts, 16, 31)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 17, 14)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 17, 17)) +} + +function other, U>() { +>other : Symbol(other, Decl(recursiveTypesUsedAsFunctionParameters.ts, 18, 1)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 20, 15)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>U : Symbol(U, Decl(recursiveTypesUsedAsFunctionParameters.ts, 20, 33)) +>U : Symbol(U, Decl(recursiveTypesUsedAsFunctionParameters.ts, 20, 33)) + + // error but wrong error + // BUG 838247 + function foo3(x: T); +>foo3 : Symbol(foo3, Decl(recursiveTypesUsedAsFunctionParameters.ts, 20, 40), Decl(recursiveTypesUsedAsFunctionParameters.ts, 23, 27)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 23, 18)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 23, 21)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 20, 15)) + + function foo3(x: MyList) { } +>foo3 : Symbol(foo3, Decl(recursiveTypesUsedAsFunctionParameters.ts, 20, 40), Decl(recursiveTypesUsedAsFunctionParameters.ts, 23, 27)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 24, 18)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 24, 21)) +>MyList : Symbol(MyList, Decl(recursiveTypesUsedAsFunctionParameters.ts, 3, 1)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 24, 18)) + + // should be error + // BUG 838247 + function foo4(x: T); +>foo4 : Symbol(foo4, Decl(recursiveTypesUsedAsFunctionParameters.ts, 24, 38), Decl(recursiveTypesUsedAsFunctionParameters.ts, 28, 27)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 28, 18)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 28, 21)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 20, 15)) + + function foo4(x: List) { } +>foo4 : Symbol(foo4, Decl(recursiveTypesUsedAsFunctionParameters.ts, 24, 38), Decl(recursiveTypesUsedAsFunctionParameters.ts, 28, 27)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 29, 18)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 29, 21)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 29, 18)) + + // ok + function foo5(x: T): string; +>foo5 : Symbol(foo5, Decl(recursiveTypesUsedAsFunctionParameters.ts, 29, 36), Decl(recursiveTypesUsedAsFunctionParameters.ts, 32, 35), Decl(recursiveTypesUsedAsFunctionParameters.ts, 33, 41), Decl(recursiveTypesUsedAsFunctionParameters.ts, 34, 44)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 32, 18)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 32, 21)) +>T : Symbol(T, Decl(recursiveTypesUsedAsFunctionParameters.ts, 20, 15)) + + function foo5(x: List): number; +>foo5 : Symbol(foo5, Decl(recursiveTypesUsedAsFunctionParameters.ts, 29, 36), Decl(recursiveTypesUsedAsFunctionParameters.ts, 32, 35), Decl(recursiveTypesUsedAsFunctionParameters.ts, 33, 41), Decl(recursiveTypesUsedAsFunctionParameters.ts, 34, 44)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 33, 18)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 33, 21)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 33, 18)) + + function foo5(x: MyList): boolean; +>foo5 : Symbol(foo5, Decl(recursiveTypesUsedAsFunctionParameters.ts, 29, 36), Decl(recursiveTypesUsedAsFunctionParameters.ts, 32, 35), Decl(recursiveTypesUsedAsFunctionParameters.ts, 33, 41), Decl(recursiveTypesUsedAsFunctionParameters.ts, 34, 44)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 34, 18)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 34, 21)) +>MyList : Symbol(MyList, Decl(recursiveTypesUsedAsFunctionParameters.ts, 3, 1)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 34, 18)) + + function foo5(x: any): any { return null; } +>foo5 : Symbol(foo5, Decl(recursiveTypesUsedAsFunctionParameters.ts, 29, 36), Decl(recursiveTypesUsedAsFunctionParameters.ts, 32, 35), Decl(recursiveTypesUsedAsFunctionParameters.ts, 33, 41), Decl(recursiveTypesUsedAsFunctionParameters.ts, 34, 44)) +>V : Symbol(V, Decl(recursiveTypesUsedAsFunctionParameters.ts, 35, 18)) +>x : Symbol(x, Decl(recursiveTypesUsedAsFunctionParameters.ts, 35, 21)) + + var list: List; +>list : Symbol(list, Decl(recursiveTypesUsedAsFunctionParameters.ts, 37, 7)) +>List : Symbol(List, Decl(recursiveTypesUsedAsFunctionParameters.ts, 0, 0)) + + var myList: MyList; +>myList : Symbol(myList, Decl(recursiveTypesUsedAsFunctionParameters.ts, 38, 7)) +>MyList : Symbol(MyList, Decl(recursiveTypesUsedAsFunctionParameters.ts, 3, 1)) + + var r = foo5(list); +>r : Symbol(r, Decl(recursiveTypesUsedAsFunctionParameters.ts, 40, 7)) +>foo5 : Symbol(foo5, Decl(recursiveTypesUsedAsFunctionParameters.ts, 29, 36), Decl(recursiveTypesUsedAsFunctionParameters.ts, 32, 35), Decl(recursiveTypesUsedAsFunctionParameters.ts, 33, 41), Decl(recursiveTypesUsedAsFunctionParameters.ts, 34, 44)) +>list : Symbol(list, Decl(recursiveTypesUsedAsFunctionParameters.ts, 37, 7)) + + var r2 = foo5(myList); +>r2 : Symbol(r2, Decl(recursiveTypesUsedAsFunctionParameters.ts, 41, 7)) +>foo5 : Symbol(foo5, Decl(recursiveTypesUsedAsFunctionParameters.ts, 29, 36), Decl(recursiveTypesUsedAsFunctionParameters.ts, 32, 35), Decl(recursiveTypesUsedAsFunctionParameters.ts, 33, 41), Decl(recursiveTypesUsedAsFunctionParameters.ts, 34, 44)) +>myList : Symbol(myList, Decl(recursiveTypesUsedAsFunctionParameters.ts, 38, 7)) +} diff --git a/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.types b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.types new file mode 100644 index 0000000000000..b800b2641fefd --- /dev/null +++ b/tests/baselines/reference/recursiveTypesUsedAsFunctionParameters.types @@ -0,0 +1,157 @@ +=== tests/cases/conformance/types/typeRelationships/recursiveTypes/recursiveTypesUsedAsFunctionParameters.ts === +class List { +>List : List +>T : T + + data: T; +>data : T +>T : T + + next: List>; +>next : List> +>List : List +>List : List +>T : T +} + +class MyList { +>MyList : MyList +>T : T + + data: T; +>data : T +>T : T + + next: MyList>; +>next : MyList> +>MyList : MyList +>MyList : MyList +>T : T +} + +function foo(x: List); +>foo : { (x: List): any; (x: List): any; } +>T : T +>x : List +>List : List +>T : T + +function foo(x: List); // error, duplicate +>foo : { (x: List): any; (x: List): any; } +>U : U +>x : List +>List : List +>U : U + +function foo(x: List) { +>foo : { (x: List): any; (x: List): any; } +>T : T +>x : List +>List : List +>T : T +} + +function foo2(x: List); +>foo2 : { (x: List): any; (x: MyList): any; } +>T : T +>x : List +>List : List +>T : T + +function foo2(x: MyList); // ok, nominally compared with first overload +>foo2 : { (x: List): any; (x: MyList): any; } +>U : U +>x : MyList +>MyList : MyList +>U : U + +function foo2(x: any) { +>foo2 : { (x: List): any; (x: MyList): any; } +>T : T +>x : any +} + +function other, U>() { +>other : , U>() => void +>T : T +>List : List +>U : U +>U : U + + // error but wrong error + // BUG 838247 + function foo3(x: T); +>foo3 : (x: T) => any +>V : V +>x : T +>T : T + + function foo3(x: MyList) { } +>foo3 : (x: T) => any +>V : V +>x : MyList +>MyList : MyList +>V : V + + // should be error + // BUG 838247 + function foo4(x: T); +>foo4 : (x: T) => any +>V : V +>x : T +>T : T + + function foo4(x: List) { } +>foo4 : (x: T) => any +>V : V +>x : List +>List : List +>V : V + + // ok + function foo5(x: T): string; +>foo5 : { (x: T): string; (x: List): number; (x: MyList): boolean; } +>V : V +>x : T +>T : T + + function foo5(x: List): number; +>foo5 : { (x: T): string; (x: List): number; (x: MyList): boolean; } +>V : V +>x : List +>List : List +>V : V + + function foo5(x: MyList): boolean; +>foo5 : { (x: T): string; (x: List): number; (x: MyList): boolean; } +>V : V +>x : MyList +>MyList : MyList +>V : V + + function foo5(x: any): any { return null; } +>foo5 : { (x: T): string; (x: List): number; (x: MyList): boolean; } +>V : V +>x : any +>null : null + + var list: List; +>list : List +>List : List + + var myList: MyList; +>myList : MyList +>MyList : MyList + + var r = foo5(list); +>r : number +>foo5(list) : number +>foo5 : { (x: T): string; (x: List): number; (x: MyList): boolean; } +>list : List + + var r2 = foo5(myList); +>r2 : number +>foo5(myList) : number +>foo5 : { (x: T): string; (x: List): number; (x: MyList): boolean; } +>myList : MyList +} diff --git a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.errors.txt b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.errors.txt index 8a916c16b2dfb..af75273ade3d5 100644 --- a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.errors.txt +++ b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.errors.txt @@ -5,15 +5,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLite tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(38,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(77,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(90,10): error TS2382: Specialized overload signature is not assignable to any non-specialized signature. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(94,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(95,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(96,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(98,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(99,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts(100,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts (13 errors) ==== +==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLiteralTypeIsSubtypeOfString.ts (7 errors) ==== // string literal types are subtypes of string, any // ok @@ -122,21 +116,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/stringLite function f14(x: any) { } function f15(x: 'a'); - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function f15(x: U); - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function f15(x: any) { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function f16(x: 'a'); - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function f16(x: U); - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function f16(x: any) { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file + function f16(x: any) { } \ No newline at end of file diff --git a/tests/baselines/reference/subtypesOfTypeParameter.errors.txt b/tests/baselines/reference/subtypesOfTypeParameter.errors.txt index 042d8227b783b..14e2275cbf971 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameter.errors.txt @@ -1,10 +1,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts(7,7): error TS2415: Class 'D1' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts(95,21): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts (2 errors) ==== +==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameter.ts (1 errors) ==== // checking whether other types are subtypes of type parameters class C3 { @@ -104,8 +103,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } function f18(a: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var r18 = true ? x : a; var r18 = true ? a : x; } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt index 2bb0db83e6df1..bd7bbeb007ecd 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.errors.txt @@ -1,142 +1,51 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(7,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(12,7): error TS2415: Class 'D2' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(12,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(14,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(17,7): error TS2415: Class 'D3' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(17,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(19,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(22,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(31,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(31,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,7): error TS2415: Class 'D6' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(36,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(38,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,7): error TS2415: Class 'D7' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(41,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(43,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,7): error TS2415: Class 'D8' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(48,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(50,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(53,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(53,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,7): error TS2415: Class 'D10' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'U' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(58,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(60,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,7): error TS2415: Class 'D11' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(65,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(67,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,7): error TS2415: Class 'D12' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(70,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(72,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(75,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(75,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,7): error TS2415: Class 'D14' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'T' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(83,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(85,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(88,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(88,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,7): error TS2415: Class 'D16' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(93,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(95,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,7): error TS2415: Class 'D17' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(98,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(100,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,7): error TS2415: Class 'D18' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'T' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(105,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(107,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,7): error TS2415: Class 'D19' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(110,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + Type 'V' is not assignable to type 'T'. + Type 'Date' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(112,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(115,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(115,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,7): error TS2415: Class 'D21' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'U' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(120,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(122,5): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,7): error TS2415: Class 'D22' incorrectly extends base class 'C3'. - Types of property 'foo' are incompatible. - Type 'T' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(127,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(129,5): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,7): error TS2415: Class 'D23' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. Type 'Date' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(132,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(134,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,7): error TS2415: Class 'D24' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. Type 'Date' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(137,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(139,5): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(142,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(142,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(149,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(149,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,7): error TS2415: Class 'D27' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'Date' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(154,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(156,5): error TS2411: Property 'foo' of type 'Date' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,7): error TS2415: Class 'D28' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'Date' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(159,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(161,5): error TS2411: Property 'foo' of type 'Date' is not assignable to string index type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,7): error TS2415: Class 'D29' incorrectly extends base class 'C3'. Types of property 'foo' are incompatible. Type 'Date' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(164,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts(166,5): error TS2411: Property 'foo' of type 'Date' is not assignable to string index type 'V'. -==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts (94 errors) ==== +==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints.ts (20 errors) ==== // checking whether other types are subtypes of type parameters with constraints class C3 { @@ -144,23 +53,13 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D1 extends C3 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; foo: T; // ok } class D2 extends C3 { - ~~ -!!! error TS2415: Class 'D2' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'T' is not assignable to type 'U'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: T; // ok - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. } class D3 extends C3 { @@ -168,8 +67,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D3' incorrectly extends base class 'C3'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'U' is not assignable to type 'T'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; foo: U; // error ~~~~~~~ @@ -177,8 +74,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D4 extends C3 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: U; // ok } @@ -188,42 +83,18 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // test if T is subtype of T, U, V // should all work class D5 extends C3 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; foo: T; // ok } class D6 extends C3 { - ~~ -!!! error TS2415: Class 'D6' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'T' is not assignable to type 'U'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: T; - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. } class D7 extends C3 { - ~~ -!!! error TS2415: Class 'D7' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'T' is not assignable to type 'V'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: V; foo: T; // ok - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. } // test if U is a subtype of T, U, V @@ -233,10 +104,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D8' incorrectly extends base class 'C3'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'U' is not assignable to type 'T'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2415: Type 'V' is not assignable to type 'T'. [x: string]: T; foo: U; // error ~~~~~~~ @@ -244,27 +112,13 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D9 extends C3 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: U; // ok } class D10 extends C3 { - ~~~ -!!! error TS2415: Class 'D10' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'U' is not assignable to type 'V'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: V; foo: U; // ok - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. } // test if V is a subtype of T, U, V @@ -274,10 +128,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D11' incorrectly extends base class 'C3'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'V' is not assignable to type 'T'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; foo: V; // error ~~~~~~~ @@ -289,10 +139,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D12' incorrectly extends base class 'C3'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'V' is not assignable to type 'U'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: V; // error ~~~~~~~ @@ -300,10 +146,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D13 extends C3 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: V; foo: V; // ok } @@ -312,74 +154,30 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // test if T is subtype of T, U, V, Date // should all work class D14 extends C3 { - ~~~ -!!! error TS2415: Class 'D14' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'T' is not assignable to type 'Date'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: Date; foo: T; // ok - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. } class D15 extends C3 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; foo: T; // ok } class D16 extends C3 { - ~~~ -!!! error TS2415: Class 'D16' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'T' is not assignable to type 'U'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: T; - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. } class D17 extends C3 { - ~~~ -!!! error TS2415: Class 'D17' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'T' is not assignable to type 'V'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: V; foo: T; - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. } // test if U is a subtype of T, U, V, Date // only a subtype of V, Date and itself class D18 extends C3 { - ~~~ -!!! error TS2415: Class 'D18' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'T' is not assignable to type 'Date'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: Date; foo: T; // ok - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. } class D19 extends C3 { @@ -387,10 +185,8 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D19' incorrectly extends base class 'C3'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'U' is not assignable to type 'T'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2415: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Type 'Date' is not assignable to type 'T'. [x: string]: T; foo: U; // error ~~~~~~~ @@ -398,44 +194,20 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D20 extends C3 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: U; // ok } class D21 extends C3 { - ~~~ -!!! error TS2415: Class 'D21' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'U' is not assignable to type 'V'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: V; foo: U; - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. } // test if V is a subtype of T, U, V, Date // only a subtype of itself and Date class D22 extends C3 { - ~~~ -!!! error TS2415: Class 'D22' incorrectly extends base class 'C3'. -!!! error TS2415: Types of property 'foo' are incompatible. -!!! error TS2415: Type 'T' is not assignable to type 'Date'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: Date; foo: T; // ok - ~~~~~~~ -!!! error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'Date'. } class D23 extends C3 { @@ -444,10 +216,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'V' is not assignable to type 'T'. !!! error TS2415: Type 'Date' is not assignable to type 'T'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; foo: V; // error ~~~~~~~ @@ -460,10 +228,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'V' is not assignable to type 'U'. !!! error TS2415: Type 'Date' is not assignable to type 'U'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: V; // error ~~~~~~~ @@ -471,10 +235,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D25 extends C3 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: V; foo: V; // ok } @@ -482,10 +242,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf // test if Date is a subtype of T, U, V, Date // only a subtype of itself class D26 extends C3 { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: Date; foo: Date; // ok } @@ -495,10 +251,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D27' incorrectly extends base class 'C3'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'Date' is not assignable to type 'T'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; foo: Date; // error ~~~~~~~~~~ @@ -510,10 +262,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D28' incorrectly extends base class 'C3'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'Date' is not assignable to type 'U'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: Date; // error ~~~~~~~~~~ @@ -525,10 +273,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D29' incorrectly extends base class 'C3'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'Date' is not assignable to type 'V'. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: V; foo: Date; // error ~~~~~~~~~~ diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.errors.txt deleted file mode 100644 index 1a2ced3b6f2c7..0000000000000 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.errors.txt +++ /dev/null @@ -1,175 +0,0 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts(3,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts(9,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts(9,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts(23,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts(143,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts (5 errors) ==== - // checking whether other types are subtypes of type parameters with constraints - - function f1(x: T, y: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var r = true ? x : y; - var r = true ? y : x; - } - - // V > U > T - function f2(x: T, y: U, z: V) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var r = true ? x : y; - var r = true ? y : x; - - // ok - var r2 = true ? z : y; - var r2 = true ? y : z; - - // ok - var r2a = true ? z : x; - var r2b = true ? x : z; - } - - // Date > U > T - function f3(x: T, y: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var r = true ? x : y; - var r = true ? y : x; - - // ok - var r2 = true ? x : new Date(); - var r2 = true ? new Date() : x; - - // ok - var r3 = true ? y : new Date(); - var r3 = true ? new Date() : y; - } - - - interface I1 { foo: number; } - class C1 { foo: number; } - class C2 { foo: T; } - enum E { A } - function f() { } - module f { - export var bar = 1; - } - class c { baz: string } - module c { - export var bar = 1; - } - - function f4(x: T) { - var r0 = true ? x : null; // ok - var r0 = true ? null : x; // ok - - var u: typeof undefined; - var r0b = true ? u : x; // ok - var r0b = true ? x : u; // ok - } - - function f5(x: T) { - var r1 = true ? 1 : x; // ok - var r1 = true ? x : 1; // ok - } - - function f6(x: T) { - var r2 = true ? '' : x; // ok - var r2 = true ? x : ''; // ok - } - - function f7(x: T) { - var r3 = true ? true : x; // ok - var r3 = true ? x : true; // ok - } - - function f8(x: T) { - var r4 = true ? new Date() : x; // ok - var r4 = true ? x : new Date(); // ok - } - - function f9(x: T) { - var r5 = true ? /1/ : x; // ok - var r5 = true ? x : /1/; // ok - } - - function f10(x: T) { - var r6 = true ? { foo: 1 } : x; // ok - var r6 = true ? x : { foo: 1 }; // ok - } - - function f11 void>(x: T) { - var r7 = true ? () => { } : x; // ok - var r7 = true ? x : () => { }; // ok - } - - function f12(x: U) => U>(x: T) { - var r8 = true ? (x: T) => { return x } : x; // ok - var r8b = true ? x : (x: T) => { return x }; // ok, type parameters not identical across declarations - } - - function f13(x: T) { - var i1: I1; - var r9 = true ? i1 : x; // ok - var r9 = true ? x : i1; // ok - } - - function f14(x: T) { - var c1: C1; - var r10 = true ? c1 : x; // ok - var r10 = true ? x : c1; // ok - } - - function f15>(x: T) { - var c2: C2; - var r12 = true ? c2 : x; // ok - var r12 = true ? x : c2; // ok - } - - function f16(x: T) { - var r13 = true ? E : x; // ok - var r13 = true ? x : E; // ok - - var r14 = true ? E.A : x; // ok - var r14 = true ? x : E.A; // ok - } - - function f17(x: T) { - var af: typeof f; - var r15 = true ? af : x; // ok - var r15 = true ? x : af; // ok - } - - function f18(x: T) { - var ac: typeof c; - var r16 = true ? ac : x; // ok - var r16 = true ? x : ac; // ok - } - - function f19(x: T) { - function f17(a: U) { - var r17 = true ? x : a; // ok - var r17 = true ? a : x; // ok - } - - function f18(a: V) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var r18 = true ? x : a; // ok - var r18 = true ? a : x; // ok - } - } - - function f20(x: T) { - var r19 = true ? new Object() : x; // ok - var r19 = true ? x : new Object(); // ok - } - - function f21(x: T) { - var r20 = true ? {} : x; // ok - var r20 = true ? x : {}; // ok - } \ No newline at end of file diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.symbols b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.symbols new file mode 100644 index 0000000000000..05276362cbed7 --- /dev/null +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.symbols @@ -0,0 +1,548 @@ +=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts === +// checking whether other types are subtypes of type parameters with constraints + +function f1(x: T, y: U) { +>f1 : Symbol(f1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 0, 0)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 12)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 24)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 24)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 28)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 12)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 33)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 24)) + + var r = true ? x : y; +>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints2.ts, 3, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 4, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 28)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 33)) + + var r = true ? y : x; +>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints2.ts, 3, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 4, 7)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 33)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 2, 28)) +} + +// V > U > T +function f2(x: T, y: U, z: V) { +>f2 : Symbol(f2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 5, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 12)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 24)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 24)) +>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 37)) +>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 37)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 41)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 12)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 46)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 24)) +>z : Symbol(z, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 52)) +>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 37)) + + var r = true ? x : y; +>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints2.ts, 9, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 10, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 41)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 46)) + + var r = true ? y : x; +>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints2.ts, 9, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 10, 7)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 46)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 41)) + + // ok + var r2 = true ? z : y; +>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 13, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 14, 7)) +>z : Symbol(z, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 52)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 46)) + + var r2 = true ? y : z; +>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 13, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 14, 7)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 46)) +>z : Symbol(z, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 52)) + + // ok + var r2a = true ? z : x; +>r2a : Symbol(r2a, Decl(subtypesOfTypeParameterWithConstraints2.ts, 17, 7)) +>z : Symbol(z, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 52)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 41)) + + var r2b = true ? x : z; +>r2b : Symbol(r2b, Decl(subtypesOfTypeParameterWithConstraints2.ts, 18, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 41)) +>z : Symbol(z, Decl(subtypesOfTypeParameterWithConstraints2.ts, 8, 52)) +} + +// Date > U > T +function f3(x: T, y: U) { +>f3 : Symbol(f3, Decl(subtypesOfTypeParameterWithConstraints2.ts, 19, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 12)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 24)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 24)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 41)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 12)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 46)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 24)) + + var r = true ? x : y; +>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints2.ts, 23, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 24, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 41)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 46)) + + var r = true ? y : x; +>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints2.ts, 23, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 24, 7)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 46)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 41)) + + // ok + var r2 = true ? x : new Date(); +>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 27, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 28, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 41)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + var r2 = true ? new Date() : x; +>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 27, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 28, 7)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 41)) + + // ok + var r3 = true ? y : new Date(); +>r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints2.ts, 31, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 32, 7)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 46)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + var r3 = true ? new Date() : y; +>r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints2.ts, 31, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 32, 7)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 46)) +} + + +interface I1 { foo: number; } +>I1 : Symbol(I1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 33, 1)) +>foo : Symbol(foo, Decl(subtypesOfTypeParameterWithConstraints2.ts, 36, 14)) + +class C1 { foo: number; } +>C1 : Symbol(C1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 36, 29)) +>foo : Symbol(foo, Decl(subtypesOfTypeParameterWithConstraints2.ts, 37, 10)) + +class C2 { foo: T; } +>C2 : Symbol(C2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 37, 25)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 38, 9)) +>foo : Symbol(foo, Decl(subtypesOfTypeParameterWithConstraints2.ts, 38, 13)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 38, 9)) + +enum E { A } +>E : Symbol(E, Decl(subtypesOfTypeParameterWithConstraints2.ts, 38, 23)) +>A : Symbol(E.A, Decl(subtypesOfTypeParameterWithConstraints2.ts, 39, 8)) + +function f() { } +>f : Symbol(f, Decl(subtypesOfTypeParameterWithConstraints2.ts, 39, 12), Decl(subtypesOfTypeParameterWithConstraints2.ts, 40, 16)) + +module f { +>f : Symbol(f, Decl(subtypesOfTypeParameterWithConstraints2.ts, 39, 12), Decl(subtypesOfTypeParameterWithConstraints2.ts, 40, 16)) + + export var bar = 1; +>bar : Symbol(bar, Decl(subtypesOfTypeParameterWithConstraints2.ts, 42, 14)) +} +class c { baz: string } +>c : Symbol(c, Decl(subtypesOfTypeParameterWithConstraints2.ts, 43, 1), Decl(subtypesOfTypeParameterWithConstraints2.ts, 44, 23)) +>baz : Symbol(baz, Decl(subtypesOfTypeParameterWithConstraints2.ts, 44, 9)) + +module c { +>c : Symbol(c, Decl(subtypesOfTypeParameterWithConstraints2.ts, 43, 1), Decl(subtypesOfTypeParameterWithConstraints2.ts, 44, 23)) + + export var bar = 1; +>bar : Symbol(bar, Decl(subtypesOfTypeParameterWithConstraints2.ts, 46, 14)) +} + +function f4(x: T) { +>f4 : Symbol(f4, Decl(subtypesOfTypeParameterWithConstraints2.ts, 47, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 49, 12)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 49, 30)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 49, 12)) + + var r0 = true ? x : null; // ok +>r0 : Symbol(r0, Decl(subtypesOfTypeParameterWithConstraints2.ts, 50, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 51, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 49, 30)) + + var r0 = true ? null : x; // ok +>r0 : Symbol(r0, Decl(subtypesOfTypeParameterWithConstraints2.ts, 50, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 51, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 49, 30)) + + var u: typeof undefined; +>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints2.ts, 53, 7)) +>undefined : Symbol(undefined) + + var r0b = true ? u : x; // ok +>r0b : Symbol(r0b, Decl(subtypesOfTypeParameterWithConstraints2.ts, 54, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 55, 7)) +>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints2.ts, 53, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 49, 30)) + + var r0b = true ? x : u; // ok +>r0b : Symbol(r0b, Decl(subtypesOfTypeParameterWithConstraints2.ts, 54, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 55, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 49, 30)) +>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints2.ts, 53, 7)) +} + +function f5(x: T) { +>f5 : Symbol(f5, Decl(subtypesOfTypeParameterWithConstraints2.ts, 56, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 58, 12)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 58, 30)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 58, 12)) + + var r1 = true ? 1 : x; // ok +>r1 : Symbol(r1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 59, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 60, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 58, 30)) + + var r1 = true ? x : 1; // ok +>r1 : Symbol(r1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 59, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 60, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 58, 30)) +} + +function f6(x: T) { +>f6 : Symbol(f6, Decl(subtypesOfTypeParameterWithConstraints2.ts, 61, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 63, 12)) +>String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 63, 30)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 63, 12)) + + var r2 = true ? '' : x; // ok +>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 64, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 65, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 63, 30)) + + var r2 = true ? x : ''; // ok +>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 64, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 65, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 63, 30)) +} + +function f7(x: T) { +>f7 : Symbol(f7, Decl(subtypesOfTypeParameterWithConstraints2.ts, 66, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 68, 12)) +>Boolean : Symbol(Boolean, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 68, 31)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 68, 12)) + + var r3 = true ? true : x; // ok +>r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints2.ts, 69, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 70, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 68, 31)) + + var r3 = true ? x : true; // ok +>r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints2.ts, 69, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 70, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 68, 31)) +} + +function f8(x: T) { +>f8 : Symbol(f8, Decl(subtypesOfTypeParameterWithConstraints2.ts, 71, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 28)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 12)) + + var r4 = true ? new Date() : x; // ok +>r4 : Symbol(r4, Decl(subtypesOfTypeParameterWithConstraints2.ts, 74, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 75, 7)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 28)) + + var r4 = true ? x : new Date(); // ok +>r4 : Symbol(r4, Decl(subtypesOfTypeParameterWithConstraints2.ts, 74, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 75, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 28)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +} + +function f9(x: T) { +>f9 : Symbol(f9, Decl(subtypesOfTypeParameterWithConstraints2.ts, 76, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 78, 12)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 78, 30)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 78, 12)) + + var r5 = true ? /1/ : x; // ok +>r5 : Symbol(r5, Decl(subtypesOfTypeParameterWithConstraints2.ts, 79, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 80, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 78, 30)) + + var r5 = true ? x : /1/; // ok +>r5 : Symbol(r5, Decl(subtypesOfTypeParameterWithConstraints2.ts, 79, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 80, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 78, 30)) +} + +function f10(x: T) { +>f10 : Symbol(f10, Decl(subtypesOfTypeParameterWithConstraints2.ts, 81, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 83, 13)) +>foo : Symbol(foo, Decl(subtypesOfTypeParameterWithConstraints2.ts, 83, 24)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 83, 40)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 83, 13)) + + var r6 = true ? { foo: 1 } : x; // ok +>r6 : Symbol(r6, Decl(subtypesOfTypeParameterWithConstraints2.ts, 84, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 85, 7)) +>foo : Symbol(foo, Decl(subtypesOfTypeParameterWithConstraints2.ts, 84, 21)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 83, 40)) + + var r6 = true ? x : { foo: 1 }; // ok +>r6 : Symbol(r6, Decl(subtypesOfTypeParameterWithConstraints2.ts, 84, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 85, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 83, 40)) +>foo : Symbol(foo, Decl(subtypesOfTypeParameterWithConstraints2.ts, 85, 25)) +} + +function f11 void>(x: T) { +>f11 : Symbol(f11, Decl(subtypesOfTypeParameterWithConstraints2.ts, 86, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 88, 13)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 88, 35)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 88, 13)) + + var r7 = true ? () => { } : x; // ok +>r7 : Symbol(r7, Decl(subtypesOfTypeParameterWithConstraints2.ts, 89, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 90, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 88, 35)) + + var r7 = true ? x : () => { }; // ok +>r7 : Symbol(r7, Decl(subtypesOfTypeParameterWithConstraints2.ts, 89, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 90, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 88, 35)) +} + +function f12(x: U) => U>(x: T) { +>f12 : Symbol(f12, Decl(subtypesOfTypeParameterWithConstraints2.ts, 91, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 93, 13)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 93, 24)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 93, 27)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 93, 24)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 93, 24)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 93, 39)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 93, 13)) + + var r8 = true ? (x: T) => { return x } : x; // ok +>r8 : Symbol(r8, Decl(subtypesOfTypeParameterWithConstraints2.ts, 94, 7)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 94, 21)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 94, 24)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 94, 21)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 94, 24)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 93, 39)) + + var r8b = true ? x : (x: T) => { return x }; // ok, type parameters not identical across declarations +>r8b : Symbol(r8b, Decl(subtypesOfTypeParameterWithConstraints2.ts, 95, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 93, 39)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 95, 26)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 95, 29)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 95, 26)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 95, 29)) +} + +function f13(x: T) { +>f13 : Symbol(f13, Decl(subtypesOfTypeParameterWithConstraints2.ts, 96, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 98, 13)) +>I1 : Symbol(I1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 33, 1)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 98, 27)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 98, 13)) + + var i1: I1; +>i1 : Symbol(i1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 99, 7)) +>I1 : Symbol(I1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 33, 1)) + + var r9 = true ? i1 : x; // ok +>r9 : Symbol(r9, Decl(subtypesOfTypeParameterWithConstraints2.ts, 100, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 101, 7)) +>i1 : Symbol(i1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 99, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 98, 27)) + + var r9 = true ? x : i1; // ok +>r9 : Symbol(r9, Decl(subtypesOfTypeParameterWithConstraints2.ts, 100, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 101, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 98, 27)) +>i1 : Symbol(i1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 99, 7)) +} + +function f14(x: T) { +>f14 : Symbol(f14, Decl(subtypesOfTypeParameterWithConstraints2.ts, 102, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 104, 13)) +>C1 : Symbol(C1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 36, 29)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 104, 27)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 104, 13)) + + var c1: C1; +>c1 : Symbol(c1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 105, 7)) +>C1 : Symbol(C1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 36, 29)) + + var r10 = true ? c1 : x; // ok +>r10 : Symbol(r10, Decl(subtypesOfTypeParameterWithConstraints2.ts, 106, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 107, 7)) +>c1 : Symbol(c1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 105, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 104, 27)) + + var r10 = true ? x : c1; // ok +>r10 : Symbol(r10, Decl(subtypesOfTypeParameterWithConstraints2.ts, 106, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 107, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 104, 27)) +>c1 : Symbol(c1, Decl(subtypesOfTypeParameterWithConstraints2.ts, 105, 7)) +} + +function f15>(x: T) { +>f15 : Symbol(f15, Decl(subtypesOfTypeParameterWithConstraints2.ts, 108, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 110, 13)) +>C2 : Symbol(C2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 37, 25)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 110, 35)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 110, 13)) + + var c2: C2; +>c2 : Symbol(c2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 111, 7)) +>C2 : Symbol(C2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 37, 25)) + + var r12 = true ? c2 : x; // ok +>r12 : Symbol(r12, Decl(subtypesOfTypeParameterWithConstraints2.ts, 112, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 113, 7)) +>c2 : Symbol(c2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 111, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 110, 35)) + + var r12 = true ? x : c2; // ok +>r12 : Symbol(r12, Decl(subtypesOfTypeParameterWithConstraints2.ts, 112, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 113, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 110, 35)) +>c2 : Symbol(c2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 111, 7)) +} + +function f16(x: T) { +>f16 : Symbol(f16, Decl(subtypesOfTypeParameterWithConstraints2.ts, 114, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 116, 13)) +>E : Symbol(E, Decl(subtypesOfTypeParameterWithConstraints2.ts, 38, 23)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 116, 26)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 116, 13)) + + var r13 = true ? E : x; // ok +>r13 : Symbol(r13, Decl(subtypesOfTypeParameterWithConstraints2.ts, 117, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 118, 7)) +>E : Symbol(E, Decl(subtypesOfTypeParameterWithConstraints2.ts, 38, 23)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 116, 26)) + + var r13 = true ? x : E; // ok +>r13 : Symbol(r13, Decl(subtypesOfTypeParameterWithConstraints2.ts, 117, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 118, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 116, 26)) +>E : Symbol(E, Decl(subtypesOfTypeParameterWithConstraints2.ts, 38, 23)) + + var r14 = true ? E.A : x; // ok +>r14 : Symbol(r14, Decl(subtypesOfTypeParameterWithConstraints2.ts, 120, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 121, 7)) +>E.A : Symbol(E.A, Decl(subtypesOfTypeParameterWithConstraints2.ts, 39, 8)) +>E : Symbol(E, Decl(subtypesOfTypeParameterWithConstraints2.ts, 38, 23)) +>A : Symbol(E.A, Decl(subtypesOfTypeParameterWithConstraints2.ts, 39, 8)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 116, 26)) + + var r14 = true ? x : E.A; // ok +>r14 : Symbol(r14, Decl(subtypesOfTypeParameterWithConstraints2.ts, 120, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 121, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 116, 26)) +>E.A : Symbol(E.A, Decl(subtypesOfTypeParameterWithConstraints2.ts, 39, 8)) +>E : Symbol(E, Decl(subtypesOfTypeParameterWithConstraints2.ts, 38, 23)) +>A : Symbol(E.A, Decl(subtypesOfTypeParameterWithConstraints2.ts, 39, 8)) +} + +function f17(x: T) { +>f17 : Symbol(f17, Decl(subtypesOfTypeParameterWithConstraints2.ts, 122, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 124, 13)) +>f : Symbol(f, Decl(subtypesOfTypeParameterWithConstraints2.ts, 39, 12), Decl(subtypesOfTypeParameterWithConstraints2.ts, 40, 16)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 124, 33)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 124, 13)) + + var af: typeof f; +>af : Symbol(af, Decl(subtypesOfTypeParameterWithConstraints2.ts, 125, 7)) +>f : Symbol(f, Decl(subtypesOfTypeParameterWithConstraints2.ts, 39, 12), Decl(subtypesOfTypeParameterWithConstraints2.ts, 40, 16)) + + var r15 = true ? af : x; // ok +>r15 : Symbol(r15, Decl(subtypesOfTypeParameterWithConstraints2.ts, 126, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 127, 7)) +>af : Symbol(af, Decl(subtypesOfTypeParameterWithConstraints2.ts, 125, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 124, 33)) + + var r15 = true ? x : af; // ok +>r15 : Symbol(r15, Decl(subtypesOfTypeParameterWithConstraints2.ts, 126, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 127, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 124, 33)) +>af : Symbol(af, Decl(subtypesOfTypeParameterWithConstraints2.ts, 125, 7)) +} + +function f18(x: T) { +>f18 : Symbol(f18, Decl(subtypesOfTypeParameterWithConstraints2.ts, 128, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 130, 13)) +>c : Symbol(c, Decl(subtypesOfTypeParameterWithConstraints2.ts, 43, 1), Decl(subtypesOfTypeParameterWithConstraints2.ts, 44, 23)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 130, 33)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 130, 13)) + + var ac: typeof c; +>ac : Symbol(ac, Decl(subtypesOfTypeParameterWithConstraints2.ts, 131, 7)) +>c : Symbol(c, Decl(subtypesOfTypeParameterWithConstraints2.ts, 43, 1), Decl(subtypesOfTypeParameterWithConstraints2.ts, 44, 23)) + + var r16 = true ? ac : x; // ok +>r16 : Symbol(r16, Decl(subtypesOfTypeParameterWithConstraints2.ts, 132, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 133, 7)) +>ac : Symbol(ac, Decl(subtypesOfTypeParameterWithConstraints2.ts, 131, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 130, 33)) + + var r16 = true ? x : ac; // ok +>r16 : Symbol(r16, Decl(subtypesOfTypeParameterWithConstraints2.ts, 132, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 133, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 130, 33)) +>ac : Symbol(ac, Decl(subtypesOfTypeParameterWithConstraints2.ts, 131, 7)) +} + +function f19(x: T) { +>f19 : Symbol(f19, Decl(subtypesOfTypeParameterWithConstraints2.ts, 134, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 13)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 16)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 13)) + + function f17(a: U) { +>f17 : Symbol(f17, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 23)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 137, 17)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 13)) +>a : Symbol(a, Decl(subtypesOfTypeParameterWithConstraints2.ts, 137, 30)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 137, 17)) + + var r17 = true ? x : a; // ok +>r17 : Symbol(r17, Decl(subtypesOfTypeParameterWithConstraints2.ts, 138, 11), Decl(subtypesOfTypeParameterWithConstraints2.ts, 139, 11)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 16)) +>a : Symbol(a, Decl(subtypesOfTypeParameterWithConstraints2.ts, 137, 30)) + + var r17 = true ? a : x; // ok +>r17 : Symbol(r17, Decl(subtypesOfTypeParameterWithConstraints2.ts, 138, 11), Decl(subtypesOfTypeParameterWithConstraints2.ts, 139, 11)) +>a : Symbol(a, Decl(subtypesOfTypeParameterWithConstraints2.ts, 137, 30)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 16)) + } + + function f18(a: V) { +>f18 : Symbol(f18, Decl(subtypesOfTypeParameterWithConstraints2.ts, 140, 5)) +>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints2.ts, 142, 17)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 142, 29)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 142, 29)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 13)) +>a : Symbol(a, Decl(subtypesOfTypeParameterWithConstraints2.ts, 142, 43)) +>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints2.ts, 142, 17)) + + var r18 = true ? x : a; // ok +>r18 : Symbol(r18, Decl(subtypesOfTypeParameterWithConstraints2.ts, 143, 11), Decl(subtypesOfTypeParameterWithConstraints2.ts, 144, 11)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 16)) +>a : Symbol(a, Decl(subtypesOfTypeParameterWithConstraints2.ts, 142, 43)) + + var r18 = true ? a : x; // ok +>r18 : Symbol(r18, Decl(subtypesOfTypeParameterWithConstraints2.ts, 143, 11), Decl(subtypesOfTypeParameterWithConstraints2.ts, 144, 11)) +>a : Symbol(a, Decl(subtypesOfTypeParameterWithConstraints2.ts, 142, 43)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 136, 16)) + } +} + +function f20(x: T) { +>f20 : Symbol(f20, Decl(subtypesOfTypeParameterWithConstraints2.ts, 146, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 148, 13)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 148, 31)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 148, 13)) + + var r19 = true ? new Object() : x; // ok +>r19 : Symbol(r19, Decl(subtypesOfTypeParameterWithConstraints2.ts, 149, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 150, 7)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 148, 31)) + + var r19 = true ? x : new Object(); // ok +>r19 : Symbol(r19, Decl(subtypesOfTypeParameterWithConstraints2.ts, 149, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 150, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 148, 31)) +>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +} + +function f21(x: T) { +>f21 : Symbol(f21, Decl(subtypesOfTypeParameterWithConstraints2.ts, 151, 1)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 153, 13)) +>Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 153, 31)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 153, 13)) + + var r20 = true ? {} : x; // ok +>r20 : Symbol(r20, Decl(subtypesOfTypeParameterWithConstraints2.ts, 154, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 155, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 153, 31)) + + var r20 = true ? x : {}; // ok +>r20 : Symbol(r20, Decl(subtypesOfTypeParameterWithConstraints2.ts, 154, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 155, 7)) +>x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 153, 31)) +} diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types new file mode 100644 index 0000000000000..39c50bde35569 --- /dev/null +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.types @@ -0,0 +1,690 @@ +=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints2.ts === +// checking whether other types are subtypes of type parameters with constraints + +function f1(x: T, y: U) { +>f1 : (x: T, y: U) => void +>T : T +>U : U +>U : U +>x : T +>T : T +>y : U +>U : U + + var r = true ? x : y; +>r : U +>true ? x : y : U +>true : boolean +>x : T +>y : U + + var r = true ? y : x; +>r : U +>true ? y : x : U +>true : boolean +>y : U +>x : T +} + +// V > U > T +function f2(x: T, y: U, z: V) { +>f2 : (x: T, y: U, z: V) => void +>T : T +>U : U +>U : U +>V : V +>V : V +>x : T +>T : T +>y : U +>U : U +>z : V +>V : V + + var r = true ? x : y; +>r : U +>true ? x : y : U +>true : boolean +>x : T +>y : U + + var r = true ? y : x; +>r : U +>true ? y : x : U +>true : boolean +>y : U +>x : T + + // ok + var r2 = true ? z : y; +>r2 : V +>true ? z : y : V +>true : boolean +>z : V +>y : U + + var r2 = true ? y : z; +>r2 : V +>true ? y : z : V +>true : boolean +>y : U +>z : V + + // ok + var r2a = true ? z : x; +>r2a : V +>true ? z : x : V +>true : boolean +>z : V +>x : T + + var r2b = true ? x : z; +>r2b : V +>true ? x : z : V +>true : boolean +>x : T +>z : V +} + +// Date > U > T +function f3(x: T, y: U) { +>f3 : (x: T, y: U) => void +>T : T +>U : U +>U : U +>Date : Date +>x : T +>T : T +>y : U +>U : U + + var r = true ? x : y; +>r : U +>true ? x : y : U +>true : boolean +>x : T +>y : U + + var r = true ? y : x; +>r : U +>true ? y : x : U +>true : boolean +>y : U +>x : T + + // ok + var r2 = true ? x : new Date(); +>r2 : Date +>true ? x : new Date() : Date +>true : boolean +>x : T +>new Date() : Date +>Date : DateConstructor + + var r2 = true ? new Date() : x; +>r2 : Date +>true ? new Date() : x : Date +>true : boolean +>new Date() : Date +>Date : DateConstructor +>x : T + + // ok + var r3 = true ? y : new Date(); +>r3 : Date +>true ? y : new Date() : Date +>true : boolean +>y : U +>new Date() : Date +>Date : DateConstructor + + var r3 = true ? new Date() : y; +>r3 : Date +>true ? new Date() : y : Date +>true : boolean +>new Date() : Date +>Date : DateConstructor +>y : U +} + + +interface I1 { foo: number; } +>I1 : I1 +>foo : number + +class C1 { foo: number; } +>C1 : C1 +>foo : number + +class C2 { foo: T; } +>C2 : C2 +>T : T +>foo : T +>T : T + +enum E { A } +>E : E +>A : E + +function f() { } +>f : typeof f + +module f { +>f : typeof f + + export var bar = 1; +>bar : number +>1 : number +} +class c { baz: string } +>c : c +>baz : string + +module c { +>c : typeof c + + export var bar = 1; +>bar : number +>1 : number +} + +function f4(x: T) { +>f4 : (x: T) => void +>T : T +>Number : Number +>x : T +>T : T + + var r0 = true ? x : null; // ok +>r0 : T +>true ? x : null : T +>true : boolean +>x : T +>null : null + + var r0 = true ? null : x; // ok +>r0 : T +>true ? null : x : T +>true : boolean +>null : null +>x : T + + var u: typeof undefined; +>u : any +>undefined : undefined + + var r0b = true ? u : x; // ok +>r0b : any +>true ? u : x : any +>true : boolean +>u : any +>x : T + + var r0b = true ? x : u; // ok +>r0b : any +>true ? x : u : any +>true : boolean +>x : T +>u : any +} + +function f5(x: T) { +>f5 : (x: T) => void +>T : T +>Number : Number +>x : T +>T : T + + var r1 = true ? 1 : x; // ok +>r1 : number | T +>true ? 1 : x : number | T +>true : boolean +>1 : number +>x : T + + var r1 = true ? x : 1; // ok +>r1 : number | T +>true ? x : 1 : T | number +>true : boolean +>x : T +>1 : number +} + +function f6(x: T) { +>f6 : (x: T) => void +>T : T +>String : String +>x : T +>T : T + + var r2 = true ? '' : x; // ok +>r2 : string | T +>true ? '' : x : string | T +>true : boolean +>'' : string +>x : T + + var r2 = true ? x : ''; // ok +>r2 : string | T +>true ? x : '' : T | string +>true : boolean +>x : T +>'' : string +} + +function f7(x: T) { +>f7 : (x: T) => void +>T : T +>Boolean : Boolean +>x : T +>T : T + + var r3 = true ? true : x; // ok +>r3 : boolean | T +>true ? true : x : boolean | T +>true : boolean +>true : boolean +>x : T + + var r3 = true ? x : true; // ok +>r3 : boolean | T +>true ? x : true : T | boolean +>true : boolean +>x : T +>true : boolean +} + +function f8(x: T) { +>f8 : (x: T) => void +>T : T +>Date : Date +>x : T +>T : T + + var r4 = true ? new Date() : x; // ok +>r4 : Date +>true ? new Date() : x : Date +>true : boolean +>new Date() : Date +>Date : DateConstructor +>x : T + + var r4 = true ? x : new Date(); // ok +>r4 : Date +>true ? x : new Date() : Date +>true : boolean +>x : T +>new Date() : Date +>Date : DateConstructor +} + +function f9(x: T) { +>f9 : (x: T) => void +>T : T +>RegExp : RegExp +>x : T +>T : T + + var r5 = true ? /1/ : x; // ok +>r5 : RegExp +>true ? /1/ : x : RegExp +>true : boolean +>/1/ : RegExp +>x : T + + var r5 = true ? x : /1/; // ok +>r5 : RegExp +>true ? x : /1/ : RegExp +>true : boolean +>x : T +>/1/ : RegExp +} + +function f10(x: T) { +>f10 : (x: T) => void +>T : T +>foo : number +>x : T +>T : T + + var r6 = true ? { foo: 1 } : x; // ok +>r6 : { foo: number; } +>true ? { foo: 1 } : x : { foo: number; } +>true : boolean +>{ foo: 1 } : { foo: number; } +>foo : number +>1 : number +>x : T + + var r6 = true ? x : { foo: 1 }; // ok +>r6 : { foo: number; } +>true ? x : { foo: 1 } : { foo: number; } +>true : boolean +>x : T +>{ foo: 1 } : { foo: number; } +>foo : number +>1 : number +} + +function f11 void>(x: T) { +>f11 : void>(x: T) => void +>T : T +>x : T +>T : T + + var r7 = true ? () => { } : x; // ok +>r7 : () => void +>true ? () => { } : x : () => void +>true : boolean +>() => { } : () => void +>x : T + + var r7 = true ? x : () => { }; // ok +>r7 : () => void +>true ? x : () => { } : () => void +>true : boolean +>x : T +>() => { } : () => void +} + +function f12(x: U) => U>(x: T) { +>f12 : (x: U) => U>(x: T) => void +>T : T +>U : U +>x : U +>U : U +>U : U +>x : T +>T : T + + var r8 = true ? (x: T) => { return x } : x; // ok +>r8 : (x: T) => T +>true ? (x: T) => { return x } : x : (x: T) => T +>true : boolean +>(x: T) => { return x } : (x: T) => T +>T : T +>x : T +>T : T +>x : T +>x : T + + var r8b = true ? x : (x: T) => { return x }; // ok, type parameters not identical across declarations +>r8b : (x: T) => T +>true ? x : (x: T) => { return x } : (x: T) => T +>true : boolean +>x : T +>(x: T) => { return x } : (x: T) => T +>T : T +>x : T +>T : T +>x : T +} + +function f13(x: T) { +>f13 : (x: T) => void +>T : T +>I1 : I1 +>x : T +>T : T + + var i1: I1; +>i1 : I1 +>I1 : I1 + + var r9 = true ? i1 : x; // ok +>r9 : I1 +>true ? i1 : x : I1 +>true : boolean +>i1 : I1 +>x : T + + var r9 = true ? x : i1; // ok +>r9 : I1 +>true ? x : i1 : I1 +>true : boolean +>x : T +>i1 : I1 +} + +function f14(x: T) { +>f14 : (x: T) => void +>T : T +>C1 : C1 +>x : T +>T : T + + var c1: C1; +>c1 : C1 +>C1 : C1 + + var r10 = true ? c1 : x; // ok +>r10 : C1 +>true ? c1 : x : C1 +>true : boolean +>c1 : C1 +>x : T + + var r10 = true ? x : c1; // ok +>r10 : C1 +>true ? x : c1 : C1 +>true : boolean +>x : T +>c1 : C1 +} + +function f15>(x: T) { +>f15 : >(x: T) => void +>T : T +>C2 : C2 +>x : T +>T : T + + var c2: C2; +>c2 : C2 +>C2 : C2 + + var r12 = true ? c2 : x; // ok +>r12 : C2 +>true ? c2 : x : C2 +>true : boolean +>c2 : C2 +>x : T + + var r12 = true ? x : c2; // ok +>r12 : C2 +>true ? x : c2 : C2 +>true : boolean +>x : T +>c2 : C2 +} + +function f16(x: T) { +>f16 : (x: T) => void +>T : T +>E : E +>x : T +>T : T + + var r13 = true ? E : x; // ok +>r13 : typeof E | T +>true ? E : x : typeof E | T +>true : boolean +>E : typeof E +>x : T + + var r13 = true ? x : E; // ok +>r13 : typeof E | T +>true ? x : E : T | typeof E +>true : boolean +>x : T +>E : typeof E + + var r14 = true ? E.A : x; // ok +>r14 : E +>true ? E.A : x : E +>true : boolean +>E.A : E +>E : typeof E +>A : E +>x : T + + var r14 = true ? x : E.A; // ok +>r14 : E +>true ? x : E.A : E +>true : boolean +>x : T +>E.A : E +>E : typeof E +>A : E +} + +function f17(x: T) { +>f17 : (x: T) => void +>T : T +>f : typeof f +>x : T +>T : T + + var af: typeof f; +>af : typeof f +>f : typeof f + + var r15 = true ? af : x; // ok +>r15 : typeof f +>true ? af : x : typeof f +>true : boolean +>af : typeof f +>x : T + + var r15 = true ? x : af; // ok +>r15 : typeof f +>true ? x : af : typeof f +>true : boolean +>x : T +>af : typeof f +} + +function f18(x: T) { +>f18 : (x: T) => void +>T : T +>c : typeof c +>x : T +>T : T + + var ac: typeof c; +>ac : typeof c +>c : typeof c + + var r16 = true ? ac : x; // ok +>r16 : typeof c +>true ? ac : x : typeof c +>true : boolean +>ac : typeof c +>x : T + + var r16 = true ? x : ac; // ok +>r16 : typeof c +>true ? x : ac : typeof c +>true : boolean +>x : T +>ac : typeof c +} + +function f19(x: T) { +>f19 : (x: T) => void +>T : T +>x : T +>T : T + + function f17(a: U) { +>f17 : (a: U) => void +>U : U +>T : T +>a : U +>U : U + + var r17 = true ? x : a; // ok +>r17 : T +>true ? x : a : T +>true : boolean +>x : T +>a : U + + var r17 = true ? a : x; // ok +>r17 : T +>true ? a : x : T +>true : boolean +>a : U +>x : T + } + + function f18(a: V) { +>f18 : (a: V) => void +>V : V +>U : U +>U : U +>T : T +>a : V +>V : V + + var r18 = true ? x : a; // ok +>r18 : T +>true ? x : a : T +>true : boolean +>x : T +>a : V + + var r18 = true ? a : x; // ok +>r18 : T +>true ? a : x : T +>true : boolean +>a : V +>x : T + } +} + +function f20(x: T) { +>f20 : (x: T) => void +>T : T +>Number : Number +>x : T +>T : T + + var r19 = true ? new Object() : x; // ok +>r19 : Object +>true ? new Object() : x : Object +>true : boolean +>new Object() : Object +>Object : ObjectConstructor +>x : T + + var r19 = true ? x : new Object(); // ok +>r19 : Object +>true ? x : new Object() : Object +>true : boolean +>x : T +>new Object() : Object +>Object : ObjectConstructor +} + +function f21(x: T) { +>f21 : (x: T) => void +>T : T +>Number : Number +>x : T +>T : T + + var r20 = true ? {} : x; // ok +>r20 : {} +>true ? {} : x : {} +>true : boolean +>{} : {} +>x : T + + var r20 = true ? x : {}; // ok +>r20 : {} +>true ? x : {} : {} +>true : boolean +>x : T +>{} : {} +} diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.errors.txt deleted file mode 100644 index 2a5fa5ad3628a..0000000000000 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints3.ts(3,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints3.ts (1 errors) ==== - // checking whether other types are subtypes of type parameters with constraints - - function f(t: T, u: U, v: V) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - // ok - var r = true ? t : u; - var r = true ? u : t; - - // ok - var r2 = true ? t : v; - var r2 = true ? v : t; - - // ok - var r3 = true ? v : u; - var r3 = true ? u : v; - } \ No newline at end of file diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.symbols b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.symbols new file mode 100644 index 0000000000000..e0223d735743b --- /dev/null +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.symbols @@ -0,0 +1,49 @@ +=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints3.ts === +// checking whether other types are subtypes of type parameters with constraints + +function f(t: T, u: U, v: V) { +>f : Symbol(f, Decl(subtypesOfTypeParameterWithConstraints3.ts, 0, 0)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 11)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 23)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 23)) +>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 26)) +>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 30)) +>T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 11)) +>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 35)) +>U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 23)) +>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 41)) +>V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 26)) + + // ok + var r = true ? t : u; +>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints3.ts, 4, 7), Decl(subtypesOfTypeParameterWithConstraints3.ts, 5, 7)) +>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 30)) +>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 35)) + + var r = true ? u : t; +>r : Symbol(r, Decl(subtypesOfTypeParameterWithConstraints3.ts, 4, 7), Decl(subtypesOfTypeParameterWithConstraints3.ts, 5, 7)) +>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 35)) +>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 30)) + + // ok + var r2 = true ? t : v; +>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints3.ts, 8, 7), Decl(subtypesOfTypeParameterWithConstraints3.ts, 9, 7)) +>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 30)) +>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 41)) + + var r2 = true ? v : t; +>r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints3.ts, 8, 7), Decl(subtypesOfTypeParameterWithConstraints3.ts, 9, 7)) +>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 41)) +>t : Symbol(t, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 30)) + + // ok + var r3 = true ? v : u; +>r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints3.ts, 12, 7), Decl(subtypesOfTypeParameterWithConstraints3.ts, 13, 7)) +>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 41)) +>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 35)) + + var r3 = true ? u : v; +>r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints3.ts, 12, 7), Decl(subtypesOfTypeParameterWithConstraints3.ts, 13, 7)) +>u : Symbol(u, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 35)) +>v : Symbol(v, Decl(subtypesOfTypeParameterWithConstraints3.ts, 2, 41)) +} diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types new file mode 100644 index 0000000000000..88c589982646f --- /dev/null +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints3.types @@ -0,0 +1,61 @@ +=== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithConstraints3.ts === +// checking whether other types are subtypes of type parameters with constraints + +function f(t: T, u: U, v: V) { +>f : (t: T, u: U, v: V) => void +>T : T +>U : U +>U : U +>V : V +>t : T +>T : T +>u : U +>U : U +>v : V +>V : V + + // ok + var r = true ? t : u; +>r : U +>true ? t : u : U +>true : boolean +>t : T +>u : U + + var r = true ? u : t; +>r : U +>true ? u : t : U +>true : boolean +>u : U +>t : T + + // ok + var r2 = true ? t : v; +>r2 : T | V +>true ? t : v : T | V +>true : boolean +>t : T +>v : V + + var r2 = true ? v : t; +>r2 : T | V +>true ? v : t : V | T +>true : boolean +>v : V +>t : T + + // ok + var r3 = true ? v : u; +>r3 : V | U +>true ? v : u : V | U +>true : boolean +>v : V +>u : U + + var r3 = true ? u : v; +>r3 : V | U +>true ? u : v : U | V +>true : boolean +>u : U +>v : V +} diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt index 22b8c3cfb35cf..a7f9d3fad7f7f 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.errors.txt @@ -1,109 +1,82 @@ -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(4,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(4,30): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(4,48): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(61,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(61,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(61,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,11): error TS2415: Class 'D2' incorrectly extends base class 'Base'. Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'T'. - Type 'Foo' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(66,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + Type 'Foo' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(68,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,11): error TS2415: Class 'D3' incorrectly extends base class 'Base'. Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'T'. - Type 'Foo' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(71,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + Type 'Foo' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(73,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,11): error TS2415: Class 'D4' incorrectly extends base class 'Base'. Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'U'. - Type 'Foo' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(76,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + Type 'Foo' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(78,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(81,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(81,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(81,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,11): error TS2415: Class 'D6' incorrectly extends base class 'Base'. Types of property 'foo' are incompatible. Type 'V' is not assignable to type 'U'. - Type 'Foo' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(86,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + Type 'Foo' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(88,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,11): error TS2415: Class 'D7' incorrectly extends base class 'Base'. Types of property 'foo' are incompatible. Type 'T' is not assignable to type 'V'. - Type 'Foo' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(91,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + Type 'Foo' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(93,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,11): error TS2415: Class 'D8' incorrectly extends base class 'Base'. Types of property 'foo' are incompatible. Type 'U' is not assignable to type 'V'. - Type 'Foo' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(96,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + Type 'Foo' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(98,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(101,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(101,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(101,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(113,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(113,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(113,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(118,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(118,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(118,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(113,11): error TS2415: Class 'D1' incorrectly extends base class 'Base2'. + Types of property 'foo' are incompatible. + Type 'T' is not assignable to type 'Foo'. + Type 'Foo' is not assignable to type 'Foo'. + Type 'U' is not assignable to type 'T'. + Type 'Foo' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(120,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(123,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(123,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(123,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(123,11): error TS2415: Class 'D3' incorrectly extends base class 'Base2'. + Types of property 'foo' are incompatible. + Type 'V' is not assignable to type 'Foo'. + Type 'Foo' is not assignable to type 'Foo'. + Type 'V' is not assignable to type 'T'. + Type 'Foo' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(125,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'T'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(128,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(128,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(128,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(130,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(133,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(133,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(133,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(138,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(138,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(138,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(133,11): error TS2415: Class 'D5' incorrectly extends base class 'Base2'. + Types of property 'foo' are incompatible. + Type 'U' is not assignable to type 'Foo'. + Type 'Foo' is not assignable to type 'Foo'. + Type 'T' is not assignable to type 'U'. + Type 'Foo' is not assignable to type 'U'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(138,11): error TS2415: Class 'D6' incorrectly extends base class 'Base2'. + Types of property 'foo' are incompatible. + Type 'V' is not assignable to type 'Foo'. + Type 'Foo' is not assignable to type 'Foo'. + Type 'V' is not assignable to type 'U'. + Type 'Foo' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(140,9): error TS2411: Property 'foo' of type 'V' is not assignable to string index type 'U'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(143,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(143,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(143,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(143,11): error TS2415: Class 'D7' incorrectly extends base class 'Base2'. + Types of property 'foo' are incompatible. + Type 'T' is not assignable to type 'Foo'. + Type 'Foo' is not assignable to type 'Foo'. + Type 'U' is not assignable to type 'V'. + Type 'Foo' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(145,9): error TS2411: Property 'foo' of type 'T' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(148,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(148,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(148,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(148,11): error TS2415: Class 'D8' incorrectly extends base class 'Base2'. + Types of property 'foo' are incompatible. + Type 'U' is not assignable to type 'Foo'. + Type 'Foo' is not assignable to type 'Foo'. + Type 'T' is not assignable to type 'V'. + Type 'Foo' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(150,9): error TS2411: Property 'foo' of type 'U' is not assignable to string index type 'V'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(153,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(153,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts(153,50): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts (75 errors) ==== +==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfTypeParameterWithRecursiveConstraints.ts (24 errors) ==== // checking whether other types are subtypes of type parameters with constraints class Foo { foo: T; } function f, U extends Foo, V extends Foo>(t: T, u: U, v: V) { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. // ok var r1 = true ? t : u; var r1 = true ? u : t; @@ -161,12 +134,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D1, U extends Foo, V extends Foo> extends Base { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; foo: T } @@ -176,13 +143,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D2' incorrectly extends base class 'Base'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'U' is not assignable to type 'T'. -!!! error TS2415: Type 'Foo' is not assignable to type 'T'. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2415: Type 'Foo' is not assignable to type 'T'. [x: string]: T; foo: U ~~~~~~ @@ -194,13 +155,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D3' incorrectly extends base class 'Base'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'V' is not assignable to type 'T'. -!!! error TS2415: Type 'Foo' is not assignable to type 'T'. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2415: Type 'Foo' is not assignable to type 'T'. [x: string]: T; foo: V ~~~~~~ @@ -212,13 +167,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D4' incorrectly extends base class 'Base'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'T' is not assignable to type 'U'. -!!! error TS2415: Type 'Foo' is not assignable to type 'U'. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2415: Type 'Foo' is not assignable to type 'U'. [x: string]: U; foo: T ~~~~~~ @@ -226,12 +175,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D5, U extends Foo, V extends Foo> extends Base { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: U } @@ -241,13 +184,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D6' incorrectly extends base class 'Base'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'V' is not assignable to type 'U'. -!!! error TS2415: Type 'Foo' is not assignable to type 'U'. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2415: Type 'Foo' is not assignable to type 'U'. [x: string]: U; foo: V ~~~~~~ @@ -259,13 +196,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D7' incorrectly extends base class 'Base'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'T' is not assignable to type 'V'. -!!! error TS2415: Type 'Foo' is not assignable to type 'V'. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2415: Type 'Foo' is not assignable to type 'V'. [x: string]: V; foo: T ~~~~~~ @@ -277,13 +208,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf !!! error TS2415: Class 'D8' incorrectly extends base class 'Base'. !!! error TS2415: Types of property 'foo' are incompatible. !!! error TS2415: Type 'U' is not assignable to type 'V'. -!!! error TS2415: Type 'Foo' is not assignable to type 'V'. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +!!! error TS2415: Type 'Foo' is not assignable to type 'V'. [x: string]: V; foo: U ~~~~~~ @@ -291,12 +216,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D9, U extends Foo, V extends Foo> extends Base { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: V; foo: V } @@ -309,23 +228,18 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D1, U extends Foo, V extends Foo> extends Base2 { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~ +!!! error TS2415: Class 'D1' incorrectly extends base class 'Base2'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'Foo'. +!!! error TS2415: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2415: Type 'U' is not assignable to type 'T'. +!!! error TS2415: Type 'Foo' is not assignable to type 'T'. [x: string]: T; foo: T } class D2, U extends Foo, V extends Foo> extends Base2 { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: T; foo: U ~~~~~~ @@ -333,12 +247,13 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D3, U extends Foo, V extends Foo> extends Base2 { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~ +!!! error TS2415: Class 'D3' incorrectly extends base class 'Base2'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'Foo'. +!!! error TS2415: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2415: Type 'V' is not assignable to type 'T'. +!!! error TS2415: Type 'Foo' is not assignable to type 'T'. [x: string]: T; foo: V ~~~~~~ @@ -346,12 +261,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D4, U extends Foo, V extends Foo> extends Base2 { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: U; foo: T ~~~~~~ @@ -359,23 +268,25 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D5, U extends Foo, V extends Foo> extends Base2 { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~ +!!! error TS2415: Class 'D5' incorrectly extends base class 'Base2'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'Foo'. +!!! error TS2415: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2415: Type 'T' is not assignable to type 'U'. +!!! error TS2415: Type 'Foo' is not assignable to type 'U'. [x: string]: U; foo: U } class D6, U extends Foo, V extends Foo> extends Base2 { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~ +!!! error TS2415: Class 'D6' incorrectly extends base class 'Base2'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'V' is not assignable to type 'Foo'. +!!! error TS2415: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2415: Type 'V' is not assignable to type 'U'. +!!! error TS2415: Type 'Foo' is not assignable to type 'U'. [x: string]: U; foo: V ~~~~~~ @@ -383,12 +294,13 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D7, U extends Foo, V extends Foo> extends Base2 { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~ +!!! error TS2415: Class 'D7' incorrectly extends base class 'Base2'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'T' is not assignable to type 'Foo'. +!!! error TS2415: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2415: Type 'U' is not assignable to type 'V'. +!!! error TS2415: Type 'Foo' is not assignable to type 'V'. [x: string]: V; foo: T ~~~~~~ @@ -396,12 +308,13 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D8, U extends Foo, V extends Foo> extends Base2 { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~~ +!!! error TS2415: Class 'D8' incorrectly extends base class 'Base2'. +!!! error TS2415: Types of property 'foo' are incompatible. +!!! error TS2415: Type 'U' is not assignable to type 'Foo'. +!!! error TS2415: Type 'Foo' is not assignable to type 'Foo'. +!!! error TS2415: Type 'T' is not assignable to type 'V'. +!!! error TS2415: Type 'Foo' is not assignable to type 'V'. [x: string]: V; foo: U ~~~~~~ @@ -409,12 +322,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf } class D9, U extends Foo, V extends Foo> extends Base2 { - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. [x: string]: V; foo: V } diff --git a/tests/baselines/reference/testTypings.errors.txt b/tests/baselines/reference/testTypings.errors.txt deleted file mode 100644 index 44480aa09fe48..0000000000000 --- a/tests/baselines/reference/testTypings.errors.txt +++ /dev/null @@ -1,19 +0,0 @@ -tests/cases/compiler/testTypings.ts(5,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/testTypings.ts (1 errors) ==== - interface IComparable { - compareTo(other: T); - } - - declare function sort>(items: U[]): U[]; - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - - - - - - - \ No newline at end of file diff --git a/tests/baselines/reference/testTypings.symbols b/tests/baselines/reference/testTypings.symbols new file mode 100644 index 0000000000000..5e3074a9585b2 --- /dev/null +++ b/tests/baselines/reference/testTypings.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/testTypings.ts === +interface IComparable { +>IComparable : Symbol(IComparable, Decl(testTypings.ts, 0, 0)) +>T : Symbol(T, Decl(testTypings.ts, 0, 22)) + + compareTo(other: T); +>compareTo : Symbol(compareTo, Decl(testTypings.ts, 0, 26)) +>other : Symbol(other, Decl(testTypings.ts, 1, 13)) +>T : Symbol(T, Decl(testTypings.ts, 0, 22)) +} + +declare function sort>(items: U[]): U[]; +>sort : Symbol(sort, Decl(testTypings.ts, 2, 1)) +>U : Symbol(U, Decl(testTypings.ts, 4, 22)) +>IComparable : Symbol(IComparable, Decl(testTypings.ts, 0, 0)) +>U : Symbol(U, Decl(testTypings.ts, 4, 22)) +>items : Symbol(items, Decl(testTypings.ts, 4, 48)) +>U : Symbol(U, Decl(testTypings.ts, 4, 22)) +>U : Symbol(U, Decl(testTypings.ts, 4, 22)) + + + + + + + + diff --git a/tests/baselines/reference/testTypings.types b/tests/baselines/reference/testTypings.types new file mode 100644 index 0000000000000..5883db8b8bbb5 --- /dev/null +++ b/tests/baselines/reference/testTypings.types @@ -0,0 +1,27 @@ +=== tests/cases/compiler/testTypings.ts === +interface IComparable { +>IComparable : IComparable +>T : T + + compareTo(other: T); +>compareTo : (other: T) => any +>other : T +>T : T +} + +declare function sort>(items: U[]): U[]; +>sort : >(items: U[]) => U[] +>U : U +>IComparable : IComparable +>U : U +>items : U[] +>U : U +>U : U + + + + + + + + diff --git a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.errors.txt deleted file mode 100644 index 08cb5348c272e..0000000000000 --- a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.errors.txt +++ /dev/null @@ -1,17 +0,0 @@ -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceTransitiveConstraints.ts(2,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceTransitiveConstraints.ts(2,42): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceTransitiveConstraints.ts (2 errors) ==== - - function fn(a: A, b: B, c: C) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - return [a, b, c]; - } - - var d = fn(new Date(), new Date(), new Date()); - var d: Date[]; // Should be OK (d should be Date[]) - \ No newline at end of file diff --git a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.symbols b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.symbols new file mode 100644 index 0000000000000..2d6270bbf5cfc --- /dev/null +++ b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceTransitiveConstraints.ts === + +function fn(a: A, b: B, c: C) { +>fn : Symbol(fn, Decl(typeArgumentInferenceTransitiveConstraints.ts, 0, 0)) +>A : Symbol(A, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>B : Symbol(B, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 27)) +>A : Symbol(A, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 12)) +>C : Symbol(C, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 40)) +>B : Symbol(B, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 27)) +>a : Symbol(a, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 54)) +>A : Symbol(A, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 12)) +>b : Symbol(b, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 59)) +>B : Symbol(B, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 27)) +>c : Symbol(c, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 65)) +>C : Symbol(C, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 40)) + + return [a, b, c]; +>a : Symbol(a, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 54)) +>b : Symbol(b, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 59)) +>c : Symbol(c, Decl(typeArgumentInferenceTransitiveConstraints.ts, 1, 65)) +} + +var d = fn(new Date(), new Date(), new Date()); +>d : Symbol(d, Decl(typeArgumentInferenceTransitiveConstraints.ts, 5, 3), Decl(typeArgumentInferenceTransitiveConstraints.ts, 6, 3)) +>fn : Symbol(fn, Decl(typeArgumentInferenceTransitiveConstraints.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +var d: Date[]; // Should be OK (d should be Date[]) +>d : Symbol(d, Decl(typeArgumentInferenceTransitiveConstraints.ts, 5, 3), Decl(typeArgumentInferenceTransitiveConstraints.ts, 6, 3)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.types b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.types new file mode 100644 index 0000000000000..6f772f10766c1 --- /dev/null +++ b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.types @@ -0,0 +1,39 @@ +=== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceTransitiveConstraints.ts === + +function fn(a: A, b: B, c: C) { +>fn : (a: A, b: B, c: C) => A[] +>A : A +>Date : Date +>B : B +>A : A +>C : C +>B : B +>a : A +>A : A +>b : B +>B : B +>c : C +>C : C + + return [a, b, c]; +>[a, b, c] : A[] +>a : A +>b : B +>c : C +} + +var d = fn(new Date(), new Date(), new Date()); +>d : Date[] +>fn(new Date(), new Date(), new Date()) : Date[] +>fn : (a: A, b: B, c: C) => A[] +>new Date() : Date +>Date : DateConstructor +>new Date() : Date +>Date : DateConstructor +>new Date() : Date +>Date : DateConstructor + +var d: Date[]; // Should be OK (d should be Date[]) +>d : Date[] +>Date : Date + diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 0c1e8cc4e973e..e6de840ec5434 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(11,17): error TS2344: Type '{}' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(14,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(16,31): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(16,23): error TS2344: Type 'number' does not satisfy the constraint 'string'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(17,23): error TS2344: Type '{}' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(32,34): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(34,15): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(41,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. @@ -43,13 +43,13 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst // Generic call with multiple type parameters and only one used in parameter type annotation function someGenerics1(n: T, m: number) { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. someGenerics1(3, 4); // Valid someGenerics1(3, 4); // Error - ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. + ~~~~~~ +!!! error TS2344: Type 'number' does not satisfy the constraint 'string'. someGenerics1(3, 4); // Error + ~~ +!!! error TS2344: Type '{}' does not satisfy the constraint 'number'. someGenerics1(3, 4); // Generic call with argument of function type whose parameter is of type parameter type diff --git a/tests/baselines/reference/typeInferenceFBoundedTypeParams.js b/tests/baselines/reference/typeInferenceFBoundedTypeParams.js new file mode 100644 index 0000000000000..3e30901df0647 --- /dev/null +++ b/tests/baselines/reference/typeInferenceFBoundedTypeParams.js @@ -0,0 +1,39 @@ +//// [typeInferenceFBoundedTypeParams.ts] +// Example from #6037 + +function fold(values: a[], result: r, fold: (result: r, value: a) => r): r { + for (let value of values) { + result = fold(result, value); + } + return result; +} + +function append(values: a[], value: b): a[] { + values.push(value); + return values; +} + +fold( + [1, 2, 3], + [] as [string, string][], + (result, value) => append( + result, + ["", ""] + ) +); + + +//// [typeInferenceFBoundedTypeParams.js] +// Example from #6037 +function fold(values, result, fold) { + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + result = fold(result, value); + } + return result; +} +function append(values, value) { + values.push(value); + return values; +} +fold([1, 2, 3], [], function (result, value) { return append(result, ["", ""]); }); diff --git a/tests/baselines/reference/typeInferenceFBoundedTypeParams.symbols b/tests/baselines/reference/typeInferenceFBoundedTypeParams.symbols new file mode 100644 index 0000000000000..f49d7b7524e4f --- /dev/null +++ b/tests/baselines/reference/typeInferenceFBoundedTypeParams.symbols @@ -0,0 +1,71 @@ +=== tests/cases/compiler/typeInferenceFBoundedTypeParams.ts === +// Example from #6037 + +function fold(values: a[], result: r, fold: (result: r, value: a) => r): r { +>fold : Symbol(fold, Decl(typeInferenceFBoundedTypeParams.ts, 0, 0)) +>a : Symbol(a, Decl(typeInferenceFBoundedTypeParams.ts, 2, 14)) +>r : Symbol(r, Decl(typeInferenceFBoundedTypeParams.ts, 2, 16)) +>values : Symbol(values, Decl(typeInferenceFBoundedTypeParams.ts, 2, 20)) +>a : Symbol(a, Decl(typeInferenceFBoundedTypeParams.ts, 2, 14)) +>result : Symbol(result, Decl(typeInferenceFBoundedTypeParams.ts, 2, 32)) +>r : Symbol(r, Decl(typeInferenceFBoundedTypeParams.ts, 2, 16)) +>fold : Symbol(fold, Decl(typeInferenceFBoundedTypeParams.ts, 2, 43)) +>result : Symbol(result, Decl(typeInferenceFBoundedTypeParams.ts, 2, 51)) +>r : Symbol(r, Decl(typeInferenceFBoundedTypeParams.ts, 2, 16)) +>value : Symbol(value, Decl(typeInferenceFBoundedTypeParams.ts, 2, 61)) +>a : Symbol(a, Decl(typeInferenceFBoundedTypeParams.ts, 2, 14)) +>r : Symbol(r, Decl(typeInferenceFBoundedTypeParams.ts, 2, 16)) +>r : Symbol(r, Decl(typeInferenceFBoundedTypeParams.ts, 2, 16)) + + for (let value of values) { +>value : Symbol(value, Decl(typeInferenceFBoundedTypeParams.ts, 3, 12)) +>values : Symbol(values, Decl(typeInferenceFBoundedTypeParams.ts, 2, 20)) + + result = fold(result, value); +>result : Symbol(result, Decl(typeInferenceFBoundedTypeParams.ts, 2, 32)) +>fold : Symbol(fold, Decl(typeInferenceFBoundedTypeParams.ts, 2, 43)) +>result : Symbol(result, Decl(typeInferenceFBoundedTypeParams.ts, 2, 32)) +>value : Symbol(value, Decl(typeInferenceFBoundedTypeParams.ts, 3, 12)) + } + return result; +>result : Symbol(result, Decl(typeInferenceFBoundedTypeParams.ts, 2, 32)) +} + +function append(values: a[], value: b): a[] { +>append : Symbol(append, Decl(typeInferenceFBoundedTypeParams.ts, 7, 1)) +>a : Symbol(a, Decl(typeInferenceFBoundedTypeParams.ts, 9, 16)) +>b : Symbol(b, Decl(typeInferenceFBoundedTypeParams.ts, 9, 18)) +>a : Symbol(a, Decl(typeInferenceFBoundedTypeParams.ts, 9, 16)) +>values : Symbol(values, Decl(typeInferenceFBoundedTypeParams.ts, 9, 32)) +>a : Symbol(a, Decl(typeInferenceFBoundedTypeParams.ts, 9, 16)) +>value : Symbol(value, Decl(typeInferenceFBoundedTypeParams.ts, 9, 44)) +>b : Symbol(b, Decl(typeInferenceFBoundedTypeParams.ts, 9, 18)) +>a : Symbol(a, Decl(typeInferenceFBoundedTypeParams.ts, 9, 16)) + + values.push(value); +>values.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>values : Symbol(values, Decl(typeInferenceFBoundedTypeParams.ts, 9, 32)) +>push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>value : Symbol(value, Decl(typeInferenceFBoundedTypeParams.ts, 9, 44)) + + return values; +>values : Symbol(values, Decl(typeInferenceFBoundedTypeParams.ts, 9, 32)) +} + +fold( +>fold : Symbol(fold, Decl(typeInferenceFBoundedTypeParams.ts, 0, 0)) + + [1, 2, 3], + [] as [string, string][], + (result, value) => append( +>result : Symbol(result, Decl(typeInferenceFBoundedTypeParams.ts, 17, 5)) +>value : Symbol(value, Decl(typeInferenceFBoundedTypeParams.ts, 17, 12)) +>append : Symbol(append, Decl(typeInferenceFBoundedTypeParams.ts, 7, 1)) + + result, +>result : Symbol(result, Decl(typeInferenceFBoundedTypeParams.ts, 17, 5)) + + ["", ""] + ) +); + diff --git a/tests/baselines/reference/typeInferenceFBoundedTypeParams.types b/tests/baselines/reference/typeInferenceFBoundedTypeParams.types new file mode 100644 index 0000000000000..0ce04aabddff6 --- /dev/null +++ b/tests/baselines/reference/typeInferenceFBoundedTypeParams.types @@ -0,0 +1,89 @@ +=== tests/cases/compiler/typeInferenceFBoundedTypeParams.ts === +// Example from #6037 + +function fold(values: a[], result: r, fold: (result: r, value: a) => r): r { +>fold : (values: a[], result: r, fold: (result: r, value: a) => r) => r +>a : a +>r : r +>values : a[] +>a : a +>result : r +>r : r +>fold : (result: r, value: a) => r +>result : r +>r : r +>value : a +>a : a +>r : r +>r : r + + for (let value of values) { +>value : a +>values : a[] + + result = fold(result, value); +>result = fold(result, value) : r +>result : r +>fold(result, value) : r +>fold : (result: r, value: a) => r +>result : r +>value : a + } + return result; +>result : r +} + +function append(values: a[], value: b): a[] { +>append : (values: a[], value: b) => a[] +>a : a +>b : b +>a : a +>values : a[] +>a : a +>value : b +>b : b +>a : a + + values.push(value); +>values.push(value) : number +>values.push : (...items: a[]) => number +>values : a[] +>push : (...items: a[]) => number +>value : b + + return values; +>values : a[] +} + +fold( +>fold( [1, 2, 3], [] as [string, string][], (result, value) => append( result, ["", ""] )) : [string, string][] +>fold : (values: a[], result: r, fold: (result: r, value: a) => r) => r + + [1, 2, 3], +>[1, 2, 3] : number[] +>1 : number +>2 : number +>3 : number + + [] as [string, string][], +>[] as [string, string][] : [string, string][] +>[] : undefined[] + + (result, value) => append( +>(result, value) => append( result, ["", ""] ) : (result: [string, string][], value: number) => [string, string][] +>result : [string, string][] +>value : number +>append( result, ["", ""] ) : [string, string][] +>append : (values: a[], value: b) => a[] + + result, +>result : [string, string][] + + ["", ""] +>["", ""] : [string, string] +>"" : string +>"" : string + + ) +); + diff --git a/tests/baselines/reference/typeParamExtendsOtherTypeParam.errors.txt b/tests/baselines/reference/typeParamExtendsOtherTypeParam.errors.txt index f943eaf5fa59c..9b385964c716d 100644 --- a/tests/baselines/reference/typeParamExtendsOtherTypeParam.errors.txt +++ b/tests/baselines/reference/typeParamExtendsOtherTypeParam.errors.txt @@ -1,14 +1,25 @@ -tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(1,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(2,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(12,26): error TS2344: Type '{ b: string; }' does not satisfy the constraint '{ a: string; }'. + Property 'a' is missing in type '{ b: string; }'. +tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(13,26): error TS2344: Type '{ a: number; }' does not satisfy the constraint '{ a: string; }'. + Types of property 'a' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(14,26): error TS2344: Type '{ b: string; }' does not satisfy the constraint '{ a: string; }'. + Property 'a' is missing in type '{ b: string; }'. +tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(15,26): error TS2344: Type '{ a: number; }' does not satisfy the constraint '{ a: string; }'. + Types of property 'a' are incompatible. + Type 'number' is not assignable to type 'string'. +tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(16,37): error TS2344: Type '{ a: string; }' does not satisfy the constraint '{ a: string; b: number; }'. + Property 'b' is missing in type '{ a: string; }'. +tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(17,37): error TS2344: Type '{ a: string; }' does not satisfy the constraint '{ a: string; b: number; }'. + Property 'b' is missing in type '{ a: string; }'. +tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(28,15): error TS2344: Type 'I1' does not satisfy the constraint 'I2'. + Property 'b' is missing in type 'I1'. +tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(29,15): error TS2344: Type 'I1' does not satisfy the constraint 'I2'. -==== tests/cases/compiler/typeParamExtendsOtherTypeParam.ts (2 errors) ==== +==== tests/cases/compiler/typeParamExtendsOtherTypeParam.ts (8 errors) ==== class A { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. class B { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. data: A; } @@ -19,11 +30,31 @@ tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(2,27): error TS2313: Cons // Below should be in error var x1: A<{ a: string;}, { b: string }>; + ~~~~~~~~~~~~~ +!!! error TS2344: Type '{ b: string; }' does not satisfy the constraint '{ a: string; }'. +!!! error TS2344: Property 'a' is missing in type '{ b: string; }'. var x2: A<{ a: string;}, { a: number }>; + ~~~~~~~~~~~~~ +!!! error TS2344: Type '{ a: number; }' does not satisfy the constraint '{ a: string; }'. +!!! error TS2344: Types of property 'a' are incompatible. +!!! error TS2344: Type 'number' is not assignable to type 'string'. var x3: B<{ a: string;}, { b: string }>; + ~~~~~~~~~~~~~ +!!! error TS2344: Type '{ b: string; }' does not satisfy the constraint '{ a: string; }'. +!!! error TS2344: Property 'a' is missing in type '{ b: string; }'. var x4: B<{ a: string;}, { a: number }>; + ~~~~~~~~~~~~~ +!!! error TS2344: Type '{ a: number; }' does not satisfy the constraint '{ a: string; }'. +!!! error TS2344: Types of property 'a' are incompatible. +!!! error TS2344: Type 'number' is not assignable to type 'string'. var x5: A<{ a: string; b: number }, { a: string }>; + ~~~~~~~~~~~~~ +!!! error TS2344: Type '{ a: string; }' does not satisfy the constraint '{ a: string; b: number; }'. +!!! error TS2344: Property 'b' is missing in type '{ a: string; }'. var x6: B<{ a: string; b: number }, { a: string }>; + ~~~~~~~~~~~~~ +!!! error TS2344: Type '{ a: string; }' does not satisfy the constraint '{ a: string; b: number; }'. +!!! error TS2344: Property 'b' is missing in type '{ a: string; }'. interface I1 { a: string; @@ -35,5 +66,10 @@ tests/cases/compiler/typeParamExtendsOtherTypeParam.ts(2,27): error TS2313: Cons } var x7: A; + ~~ +!!! error TS2344: Type 'I1' does not satisfy the constraint 'I2'. +!!! error TS2344: Property 'b' is missing in type 'I1'. var x8: B; + ~~ +!!! error TS2344: Type 'I1' does not satisfy the constraint 'I2'. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.errors.txt b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.errors.txt deleted file mode 100644 index b4f8e7544ff82..0000000000000 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.errors.txt +++ /dev/null @@ -1,35 +0,0 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.ts(4,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.ts(21,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.ts (2 errors) ==== - // using a type parameter as a constraint for a type parameter is valid - // no errors expected except illegal constraints - - function foo(x: T, y: U): U { return y; } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - var r = foo(1, 2); - var r = foo({}, 1); - - interface A { - foo: string; - } - interface B extends A { - bar: number; - } - var a: A; - var b: B; - - var r2 = foo(a, b); - var r3 = foo({ x: 1 }, { x: 2, y: 3 }); - - function foo2(x: T, y: U) { return y; } - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - foo2(1, ''); - foo2({}, { length: 2 }); - foo2(1, { width: 3, length: 2 }); - foo2(1, []); - foo2(1, ['']); \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.symbols b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.symbols new file mode 100644 index 0000000000000..569b37e64d1dc --- /dev/null +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.symbols @@ -0,0 +1,88 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.ts === +// using a type parameter as a constraint for a type parameter is valid +// no errors expected except illegal constraints + +function foo(x: T, y: U): U { return y; } +>foo : Symbol(foo, Decl(typeParameterAsTypeParameterConstraint.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterAsTypeParameterConstraint.ts, 3, 13)) +>U : Symbol(U, Decl(typeParameterAsTypeParameterConstraint.ts, 3, 15)) +>T : Symbol(T, Decl(typeParameterAsTypeParameterConstraint.ts, 3, 13)) +>x : Symbol(x, Decl(typeParameterAsTypeParameterConstraint.ts, 3, 29)) +>T : Symbol(T, Decl(typeParameterAsTypeParameterConstraint.ts, 3, 13)) +>y : Symbol(y, Decl(typeParameterAsTypeParameterConstraint.ts, 3, 34)) +>U : Symbol(U, Decl(typeParameterAsTypeParameterConstraint.ts, 3, 15)) +>U : Symbol(U, Decl(typeParameterAsTypeParameterConstraint.ts, 3, 15)) +>y : Symbol(y, Decl(typeParameterAsTypeParameterConstraint.ts, 3, 34)) + +var r = foo(1, 2); +>r : Symbol(r, Decl(typeParameterAsTypeParameterConstraint.ts, 5, 3), Decl(typeParameterAsTypeParameterConstraint.ts, 6, 3)) +>foo : Symbol(foo, Decl(typeParameterAsTypeParameterConstraint.ts, 0, 0)) + +var r = foo({}, 1); +>r : Symbol(r, Decl(typeParameterAsTypeParameterConstraint.ts, 5, 3), Decl(typeParameterAsTypeParameterConstraint.ts, 6, 3)) +>foo : Symbol(foo, Decl(typeParameterAsTypeParameterConstraint.ts, 0, 0)) + +interface A { +>A : Symbol(A, Decl(typeParameterAsTypeParameterConstraint.ts, 6, 19)) + + foo: string; +>foo : Symbol(foo, Decl(typeParameterAsTypeParameterConstraint.ts, 8, 13)) +} +interface B extends A { +>B : Symbol(B, Decl(typeParameterAsTypeParameterConstraint.ts, 10, 1)) +>A : Symbol(A, Decl(typeParameterAsTypeParameterConstraint.ts, 6, 19)) + + bar: number; +>bar : Symbol(bar, Decl(typeParameterAsTypeParameterConstraint.ts, 11, 23)) +} +var a: A; +>a : Symbol(a, Decl(typeParameterAsTypeParameterConstraint.ts, 14, 3)) +>A : Symbol(A, Decl(typeParameterAsTypeParameterConstraint.ts, 6, 19)) + +var b: B; +>b : Symbol(b, Decl(typeParameterAsTypeParameterConstraint.ts, 15, 3)) +>B : Symbol(B, Decl(typeParameterAsTypeParameterConstraint.ts, 10, 1)) + +var r2 = foo(a, b); +>r2 : Symbol(r2, Decl(typeParameterAsTypeParameterConstraint.ts, 17, 3)) +>foo : Symbol(foo, Decl(typeParameterAsTypeParameterConstraint.ts, 0, 0)) +>a : Symbol(a, Decl(typeParameterAsTypeParameterConstraint.ts, 14, 3)) +>b : Symbol(b, Decl(typeParameterAsTypeParameterConstraint.ts, 15, 3)) + +var r3 = foo({ x: 1 }, { x: 2, y: 3 }); +>r3 : Symbol(r3, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 3)) +>foo : Symbol(foo, Decl(typeParameterAsTypeParameterConstraint.ts, 0, 0)) +>x : Symbol(x, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 14)) +>x : Symbol(x, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 24)) +>y : Symbol(y, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 30)) + +function foo2(x: T, y: U) { return y; } +>foo2 : Symbol(foo2, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 39)) +>T : Symbol(T, Decl(typeParameterAsTypeParameterConstraint.ts, 20, 14)) +>U : Symbol(U, Decl(typeParameterAsTypeParameterConstraint.ts, 20, 16)) +>length : Symbol(length, Decl(typeParameterAsTypeParameterConstraint.ts, 20, 28)) +>T : Symbol(T, Decl(typeParameterAsTypeParameterConstraint.ts, 20, 14)) +>x : Symbol(x, Decl(typeParameterAsTypeParameterConstraint.ts, 20, 42)) +>T : Symbol(T, Decl(typeParameterAsTypeParameterConstraint.ts, 20, 14)) +>y : Symbol(y, Decl(typeParameterAsTypeParameterConstraint.ts, 20, 47)) +>U : Symbol(U, Decl(typeParameterAsTypeParameterConstraint.ts, 20, 16)) +>y : Symbol(y, Decl(typeParameterAsTypeParameterConstraint.ts, 20, 47)) + +foo2(1, ''); +>foo2 : Symbol(foo2, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 39)) + +foo2({}, { length: 2 }); +>foo2 : Symbol(foo2, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 39)) +>length : Symbol(length, Decl(typeParameterAsTypeParameterConstraint.ts, 22, 10)) + +foo2(1, { width: 3, length: 2 }); +>foo2 : Symbol(foo2, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 39)) +>width : Symbol(width, Decl(typeParameterAsTypeParameterConstraint.ts, 23, 9)) +>length : Symbol(length, Decl(typeParameterAsTypeParameterConstraint.ts, 23, 19)) + +foo2(1, []); +>foo2 : Symbol(foo2, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 39)) + +foo2(1, ['']); +>foo2 : Symbol(foo2, Decl(typeParameterAsTypeParameterConstraint.ts, 18, 39)) + diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types new file mode 100644 index 0000000000000..c5f15f1ba5596 --- /dev/null +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types @@ -0,0 +1,120 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint.ts === +// using a type parameter as a constraint for a type parameter is valid +// no errors expected except illegal constraints + +function foo(x: T, y: U): U { return y; } +>foo : (x: T, y: U) => U +>T : T +>U : U +>T : T +>x : T +>T : T +>y : U +>U : U +>U : U +>y : U + +var r = foo(1, 2); +>r : number +>foo(1, 2) : number +>foo : (x: T, y: U) => U +>1 : number +>2 : number + +var r = foo({}, 1); +>r : number +>foo({}, 1) : number +>foo : (x: T, y: U) => U +>{} : {} +>1 : number + +interface A { +>A : A + + foo: string; +>foo : string +} +interface B extends A { +>B : B +>A : A + + bar: number; +>bar : number +} +var a: A; +>a : A +>A : A + +var b: B; +>b : B +>B : B + +var r2 = foo(a, b); +>r2 : B +>foo(a, b) : B +>foo : (x: T, y: U) => U +>a : A +>b : B + +var r3 = foo({ x: 1 }, { x: 2, y: 3 }); +>r3 : { x: number; y: number; } +>foo({ x: 1 }, { x: 2, y: 3 }) : { x: number; y: number; } +>foo : (x: T, y: U) => U +>{ x: 1 } : { x: number; } +>x : number +>1 : number +>{ x: 2, y: 3 } : { x: number; y: number; } +>x : number +>2 : number +>y : number +>3 : number + +function foo2(x: T, y: U) { return y; } +>foo2 : (x: T, y: U) => U +>T : T +>U : U +>length : T +>T : T +>x : T +>T : T +>y : U +>U : U +>y : U + +foo2(1, ''); +>foo2(1, '') : string +>foo2 : (x: T, y: U) => U +>1 : number +>'' : string + +foo2({}, { length: 2 }); +>foo2({}, { length: 2 }) : { length: number; } +>foo2 : (x: T, y: U) => U +>{} : {} +>{ length: 2 } : { length: number; } +>length : number +>2 : number + +foo2(1, { width: 3, length: 2 }); +>foo2(1, { width: 3, length: 2 }) : { width: number; length: number; } +>foo2 : (x: T, y: U) => U +>1 : number +>{ width: 3, length: 2 } : { width: number; length: number; } +>width : number +>3 : number +>length : number +>2 : number + +foo2(1, []); +>foo2(1, []) : any[] +>foo2 : (x: T, y: U) => U +>1 : number +>[] : undefined[] + +foo2(1, ['']); +>foo2(1, ['']) : string[] +>foo2 : (x: T, y: U) => U +>1 : number +>[''] : string[] +>'' : string + diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt index 8652bb7aee554..282e942e0f733 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt @@ -1,27 +1,53 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(4,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(15,18): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(6,8): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(7,8): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(13,17): error TS2345: Argument of type 'NumberVariant' is not assignable to parameter of type 'number'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(16,9): error TS2345: Argument of type '{ length: string; }' is not assignable to parameter of type '{ length: number; }'. + Types of property 'length' are incompatible. + Type 'string' is not assignable to type 'number'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(17,9): error TS2345: Argument of type '{ length: {}; }' is not assignable to parameter of type '{ length: number; }'. + Types of property 'length' are incompatible. + Type '{}' is not assignable to type 'number'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(18,10): error TS2345: Argument of type 'string[]' is not assignable to parameter of type '{ length: any[]; }'. + Types of property 'length' are incompatible. + Type 'number' is not assignable to type 'any[]'. + Property 'length' is missing in type 'Number'. -==== tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts (2 errors) ==== +==== tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts (6 errors) ==== // using a type parameter as a constraint for a type parameter is invalid // these should be errors unless otherwise noted function foo(x: T, y: U): U { return y; } // this is now an error - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo(1, ''); + ~~ +!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. foo(1, {}); + ~~ +!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. interface NumberVariant extends Number { x: number; } var n: NumberVariant; var r3 = foo(1, n); + ~ +!!! error TS2345: Argument of type 'NumberVariant' is not assignable to parameter of type 'number'. function foo2(x: T, y: U) { return y; } // this is now an error - ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo2(1, { length: '' }); + ~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ length: string; }' is not assignable to parameter of type '{ length: number; }'. +!!! error TS2345: Types of property 'length' are incompatible. +!!! error TS2345: Type 'string' is not assignable to type 'number'. foo2(1, { length: {} }); - foo2([], ['']); \ No newline at end of file + ~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ length: {}; }' is not assignable to parameter of type '{ length: number; }'. +!!! error TS2345: Types of property 'length' are incompatible. +!!! error TS2345: Type '{}' is not assignable to type 'number'. + foo2([], ['']); + ~~~~ +!!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type '{ length: any[]; }'. +!!! error TS2345: Types of property 'length' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'any[]'. +!!! error TS2345: Property 'length' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignability2.errors.txt b/tests/baselines/reference/typeParameterAssignability2.errors.txt index ab8803e0478dc..e6159fd713583 100644 --- a/tests/baselines/reference/typeParameterAssignability2.errors.txt +++ b/tests/baselines/reference/typeParameterAssignability2.errors.txt @@ -1,116 +1,78 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(3,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(5,5): error TS2322: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(8,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(9,5): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(10,5): error TS2322: Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(13,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(13,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(15,5): error TS2322: Type 'T' is not assignable to type 'U'. + Type 'V' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(17,5): error TS2322: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(18,5): error TS2322: Type 'T' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(20,5): error TS2322: Type 'V' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(21,5): error TS2322: Type 'U' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(24,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(24,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(25,5): error TS2322: Type 'U' is not assignable to type 'T'. + Type 'V' is not assignable to type 'T'. + Type 'Date' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(26,5): error TS2322: Type 'V' is not assignable to type 'T'. Type 'Date' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(27,5): error TS2322: Type 'Date' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(29,5): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(30,5): error TS2322: Type 'V' is not assignable to type 'U'. Type 'Date' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(31,5): error TS2322: Type 'Date' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(33,5): error TS2322: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(34,5): error TS2322: Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(35,5): error TS2322: Type 'Date' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(38,5): error TS2322: Type 'T' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(39,5): error TS2322: Type 'U' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(44,31): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(44,44): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(45,5): error TS2322: Type 'U' is not assignable to type 'T'. + Type 'V' is not assignable to type 'T'. + Type 'Date' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(46,5): error TS2322: Type 'V' is not assignable to type 'T'. Type 'Date' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(47,5): error TS2322: Type 'Date' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(49,5): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(50,5): error TS2322: Type 'V' is not assignable to type 'U'. Type 'Date' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(51,5): error TS2322: Type 'Date' is not assignable to type 'U'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(53,5): error TS2322: Type 'T' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(54,5): error TS2322: Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(55,5): error TS2322: Type 'Date' is not assignable to type 'V'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(58,5): error TS2322: Type 'T' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(59,5): error TS2322: Type 'U' is not assignable to type 'Date'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(63,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(64,5): error TS2322: Type 'U' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(65,5): error TS2322: Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(67,5): error TS2322: Type 'T' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(68,5): error TS2322: Type 'V' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(70,5): error TS2322: Type 'T' is not assignable to type 'V'. + Type 'U' is not assignable to type 'V'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts(71,5): error TS2322: Type 'U' is not assignable to type 'V'. -==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts (47 errors) ==== +==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typeParameterAssignability2.ts (22 errors) ==== // type parameters are not assignable to one another unless directly or indirectly constrained to one another function foo(t: T, u: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // ok ~ !!! error TS2322: Type 'T' is not assignable to type 'U'. } function foo2(t: T, u: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ !!! error TS2322: Type 'U' is not assignable to type 'T'. u = t; // ok - ~ -!!! error TS2322: Type 'T' is not assignable to type 'U'. } function foo3(t: T, u: U, v: V) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ !!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. u = t; - ~ -!!! error TS2322: Type 'T' is not assignable to type 'U'. t = v; // error ~ !!! error TS2322: Type 'V' is not assignable to type 'T'. v = t; // ok - ~ -!!! error TS2322: Type 'T' is not assignable to type 'V'. u = v; // error ~ !!! error TS2322: Type 'V' is not assignable to type 'U'. v = u; // ok - ~ -!!! error TS2322: Type 'U' is not assignable to type 'V'. } function foo4(t: T, u: U, v: V) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ !!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'Date' is not assignable to type 'T'. t = v; // error ~ !!! error TS2322: Type 'V' is not assignable to type 'T'. @@ -120,8 +82,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2322: Type 'Date' is not assignable to type 'T'. u = t; - ~ -!!! error TS2322: Type 'T' is not assignable to type 'U'. u = v; // error ~ !!! error TS2322: Type 'V' is not assignable to type 'U'. @@ -131,34 +91,24 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2322: Type 'Date' is not assignable to type 'U'. v = t; - ~ -!!! error TS2322: Type 'T' is not assignable to type 'V'. v = u; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'V'. v = new Date(); // ok ~ !!! error TS2322: Type 'Date' is not assignable to type 'V'. var d: Date; d = t; // ok - ~ -!!! error TS2322: Type 'T' is not assignable to type 'Date'. d = u; // ok - ~ -!!! error TS2322: Type 'U' is not assignable to type 'Date'. d = v; // ok } // same as foo4 with different type parameter ordering function foo5(t: T, u: U, v: V) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ !!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2322: Type 'V' is not assignable to type 'T'. +!!! error TS2322: Type 'Date' is not assignable to type 'T'. t = v; // error ~ !!! error TS2322: Type 'V' is not assignable to type 'T'. @@ -168,8 +118,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2322: Type 'Date' is not assignable to type 'T'. u = t; - ~ -!!! error TS2322: Type 'T' is not assignable to type 'U'. u = v; // error ~ !!! error TS2322: Type 'V' is not assignable to type 'U'. @@ -179,28 +127,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2322: Type 'Date' is not assignable to type 'U'. v = t; - ~ -!!! error TS2322: Type 'T' is not assignable to type 'V'. v = u; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'V'. v = new Date(); // ok ~ !!! error TS2322: Type 'Date' is not assignable to type 'V'. var d: Date; d = t; // ok - ~ -!!! error TS2322: Type 'T' is not assignable to type 'Date'. d = u; // ok - ~ -!!! error TS2322: Type 'U' is not assignable to type 'Date'. d = v; // ok } function foo6(t: T, u: U, v: V) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. t = u; // error ~ !!! error TS2322: Type 'U' is not assignable to type 'T'. @@ -209,8 +147,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara !!! error TS2322: Type 'V' is not assignable to type 'T'. u = t; // ok - ~ -!!! error TS2322: Type 'T' is not assignable to type 'U'. u = v; // error ~ !!! error TS2322: Type 'V' is not assignable to type 'U'. @@ -218,6 +154,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/typePara v = t; // error ~ !!! error TS2322: Type 'T' is not assignable to type 'V'. +!!! error TS2322: Type 'U' is not assignable to type 'V'. v = u; // error ~ !!! error TS2322: Type 'U' is not assignable to type 'V'. diff --git a/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt b/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt deleted file mode 100644 index 3ada2e3c375b4..0000000000000 --- a/tests/baselines/reference/typeParameterAssignmentWithConstraints.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(1,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/typeParameterAssignmentWithConstraints.ts(4,5): error TS2322: Type 'B' is not assignable to type 'A'. - - -==== tests/cases/compiler/typeParameterAssignmentWithConstraints.ts (2 errors) ==== - function f() { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var a: A; - var b: B; - a = b; // Error: Can't convert B to A - ~ -!!! error TS2322: Type 'B' is not assignable to type 'A'. - } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAssignmentWithConstraints.symbols b/tests/baselines/reference/typeParameterAssignmentWithConstraints.symbols new file mode 100644 index 0000000000000..c537235453237 --- /dev/null +++ b/tests/baselines/reference/typeParameterAssignmentWithConstraints.symbols @@ -0,0 +1,19 @@ +=== tests/cases/compiler/typeParameterAssignmentWithConstraints.ts === +function f() { +>f : Symbol(f, Decl(typeParameterAssignmentWithConstraints.ts, 0, 0)) +>A : Symbol(A, Decl(typeParameterAssignmentWithConstraints.ts, 0, 11)) +>B : Symbol(B, Decl(typeParameterAssignmentWithConstraints.ts, 0, 13)) +>A : Symbol(A, Decl(typeParameterAssignmentWithConstraints.ts, 0, 11)) + + var a: A; +>a : Symbol(a, Decl(typeParameterAssignmentWithConstraints.ts, 1, 7)) +>A : Symbol(A, Decl(typeParameterAssignmentWithConstraints.ts, 0, 11)) + + var b: B; +>b : Symbol(b, Decl(typeParameterAssignmentWithConstraints.ts, 2, 7)) +>B : Symbol(B, Decl(typeParameterAssignmentWithConstraints.ts, 0, 13)) + + a = b; // Error: Can't convert B to A +>a : Symbol(a, Decl(typeParameterAssignmentWithConstraints.ts, 1, 7)) +>b : Symbol(b, Decl(typeParameterAssignmentWithConstraints.ts, 2, 7)) +} diff --git a/tests/baselines/reference/typeParameterAssignmentWithConstraints.types b/tests/baselines/reference/typeParameterAssignmentWithConstraints.types new file mode 100644 index 0000000000000..fc7f7e31830f0 --- /dev/null +++ b/tests/baselines/reference/typeParameterAssignmentWithConstraints.types @@ -0,0 +1,20 @@ +=== tests/cases/compiler/typeParameterAssignmentWithConstraints.ts === +function f() { +>f : () => void +>A : A +>B : B +>A : A + + var a: A; +>a : A +>A : A + + var b: B; +>b : B +>B : B + + a = b; // Error: Can't convert B to A +>a = b : B +>a : A +>b : B +} diff --git a/tests/baselines/reference/typeParameterConstraintInstantiation.js b/tests/baselines/reference/typeParameterConstraintInstantiation.js new file mode 100644 index 0000000000000..225536941cab5 --- /dev/null +++ b/tests/baselines/reference/typeParameterConstraintInstantiation.js @@ -0,0 +1,15 @@ +//// [typeParameterConstraintInstantiation.ts] +// Check that type parameter constraints are properly instantiated + +interface Mapper { + map(f: (item: T) => U): V; +} + +var m: Mapper; +var a = m.map((x: string) => x); // string[] + + +//// [typeParameterConstraintInstantiation.js] +// Check that type parameter constraints are properly instantiated +var m; +var a = m.map(function (x) { return x; }); // string[] diff --git a/tests/baselines/reference/typeParameterConstraintInstantiation.symbols b/tests/baselines/reference/typeParameterConstraintInstantiation.symbols new file mode 100644 index 0000000000000..9103d65c0e94b --- /dev/null +++ b/tests/baselines/reference/typeParameterConstraintInstantiation.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/typeParameterConstraintInstantiation.ts === +// Check that type parameter constraints are properly instantiated + +interface Mapper { +>Mapper : Symbol(Mapper, Decl(typeParameterConstraintInstantiation.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterConstraintInstantiation.ts, 2, 17)) + + map(f: (item: T) => U): V; +>map : Symbol(map, Decl(typeParameterConstraintInstantiation.ts, 2, 21)) +>U : Symbol(U, Decl(typeParameterConstraintInstantiation.ts, 3, 8)) +>T : Symbol(T, Decl(typeParameterConstraintInstantiation.ts, 2, 17)) +>V : Symbol(V, Decl(typeParameterConstraintInstantiation.ts, 3, 20)) +>U : Symbol(U, Decl(typeParameterConstraintInstantiation.ts, 3, 8)) +>f : Symbol(f, Decl(typeParameterConstraintInstantiation.ts, 3, 36)) +>item : Symbol(item, Decl(typeParameterConstraintInstantiation.ts, 3, 40)) +>T : Symbol(T, Decl(typeParameterConstraintInstantiation.ts, 2, 17)) +>U : Symbol(U, Decl(typeParameterConstraintInstantiation.ts, 3, 8)) +>V : Symbol(V, Decl(typeParameterConstraintInstantiation.ts, 3, 20)) +} + +var m: Mapper; +>m : Symbol(m, Decl(typeParameterConstraintInstantiation.ts, 6, 3)) +>Mapper : Symbol(Mapper, Decl(typeParameterConstraintInstantiation.ts, 0, 0)) + +var a = m.map((x: string) => x); // string[] +>a : Symbol(a, Decl(typeParameterConstraintInstantiation.ts, 7, 3)) +>m.map : Symbol(Mapper.map, Decl(typeParameterConstraintInstantiation.ts, 2, 21)) +>m : Symbol(m, Decl(typeParameterConstraintInstantiation.ts, 6, 3)) +>map : Symbol(Mapper.map, Decl(typeParameterConstraintInstantiation.ts, 2, 21)) +>x : Symbol(x, Decl(typeParameterConstraintInstantiation.ts, 7, 15)) +>x : Symbol(x, Decl(typeParameterConstraintInstantiation.ts, 7, 15)) + diff --git a/tests/baselines/reference/typeParameterConstraintInstantiation.types b/tests/baselines/reference/typeParameterConstraintInstantiation.types new file mode 100644 index 0000000000000..5f806d57ea2f3 --- /dev/null +++ b/tests/baselines/reference/typeParameterConstraintInstantiation.types @@ -0,0 +1,34 @@ +=== tests/cases/compiler/typeParameterConstraintInstantiation.ts === +// Check that type parameter constraints are properly instantiated + +interface Mapper { +>Mapper : Mapper +>T : T + + map(f: (item: T) => U): V; +>map : (f: (item: T) => U) => V +>U : U +>T : T +>V : V +>U : U +>f : (item: T) => U +>item : T +>T : T +>U : U +>V : V +} + +var m: Mapper; +>m : Mapper +>Mapper : Mapper + +var a = m.map((x: string) => x); // string[] +>a : string[] +>m.map((x: string) => x) : string[] +>m.map : (f: (item: string) => U) => V +>m : Mapper +>map : (f: (item: string) => U) => V +>(x: string) => x : (x: string) => string +>x : string +>x : string + diff --git a/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.errors.txt b/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.errors.txt index 496d0f3f55ae8..540ad8346a1c3 100644 --- a/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.errors.txt +++ b/tests/baselines/reference/typeParameterDirectlyConstrainedToItself.errors.txt @@ -1,51 +1,51 @@ -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(3,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(4,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(6,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(7,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(9,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(10,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(13,6): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(14,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(17,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(18,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(3,19): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(4,23): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(6,23): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(7,27): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(9,22): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(10,26): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(13,16): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(14,19): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(17,20): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts(18,24): error TS2313: Type parameter 'U' has a circular constraint. ==== tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterDirectlyConstrainedToItself.ts (10 errors) ==== // all of the below should be errors class C { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. class C2 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. interface I { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. interface I2 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. function f() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. function f2() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. var a: { (): void; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. (): void; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. } var b = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. var b2 = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt b/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt index 409aa5ebfb6c7..b459534080f8f 100644 --- a/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt +++ b/tests/baselines/reference/typeParameterHasSelfAsConstraint.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(1,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(1,24): error TS2313: Type parameter 'T' has a circular constraint. tests/cases/compiler/typeParameterHasSelfAsConstraint.ts(2,12): error TS2322: Type 'T' is not assignable to type 'number'. ==== tests/cases/compiler/typeParameterHasSelfAsConstraint.ts (2 errors) ==== function foo(x: T): number { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. return x; ~ !!! error TS2322: Type 'T' is not assignable to type 'number'. diff --git a/tests/baselines/reference/typeParameterInConstraint1.errors.txt b/tests/baselines/reference/typeParameterInConstraint1.errors.txt deleted file mode 100644 index ee8e9dcf37ff3..0000000000000 --- a/tests/baselines/reference/typeParameterInConstraint1.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/compiler/typeParameterInConstraint1.ts(1,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/typeParameterInConstraint1.ts (1 errors) ==== - class C { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterInConstraint1.symbols b/tests/baselines/reference/typeParameterInConstraint1.symbols new file mode 100644 index 0000000000000..284e73911cffd --- /dev/null +++ b/tests/baselines/reference/typeParameterInConstraint1.symbols @@ -0,0 +1,7 @@ +=== tests/cases/compiler/typeParameterInConstraint1.ts === +class C { +>C : Symbol(C, Decl(typeParameterInConstraint1.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterInConstraint1.ts, 0, 8)) +>U : Symbol(U, Decl(typeParameterInConstraint1.ts, 0, 10)) +>T : Symbol(T, Decl(typeParameterInConstraint1.ts, 0, 8)) +} diff --git a/tests/baselines/reference/typeParameterInConstraint1.types b/tests/baselines/reference/typeParameterInConstraint1.types new file mode 100644 index 0000000000000..5163f4a053cf0 --- /dev/null +++ b/tests/baselines/reference/typeParameterInConstraint1.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/typeParameterInConstraint1.ts === +class C { +>C : C +>T : T +>U : U +>T : T +} diff --git a/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.errors.txt b/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.errors.txt index 2b969daf7ee2c..4cfa9da213395 100644 --- a/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.errors.txt +++ b/tests/baselines/reference/typeParameterIndirectlyConstrainedToItself.errors.txt @@ -1,105 +1,102 @@ -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(1,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(2,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(2,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(2,36): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(4,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(4,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(5,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(5,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(5,40): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(7,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(7,25): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(8,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(8,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(8,39): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(11,6): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(11,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(12,6): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(12,19): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(12,32): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(15,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(15,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(16,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(16,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(16,37): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(18,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(18,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(18,35): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(1,19): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(1,32): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(2,20): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(2,33): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(2,46): error TS2313: Type parameter 'V' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(4,23): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(4,36): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(5,24): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(5,37): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(5,50): error TS2313: Type parameter 'V' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(7,22): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(7,35): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(8,23): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(8,36): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(8,49): error TS2313: Type parameter 'V' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(11,16): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(11,29): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(12,16): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(12,29): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(12,42): error TS2313: Type parameter 'V' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(15,20): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(15,33): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(16,21): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(16,34): error TS2313: Type parameter 'U' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(16,47): error TS2313: Type parameter 'V' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(18,32): error TS2313: Type parameter 'T' has a circular constraint. +tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts(18,45): error TS2313: Type parameter 'V' has a circular constraint. -==== tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts (28 errors) ==== +==== tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterIndirectlyConstrainedToItself.ts (27 errors) ==== class C { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. class C2 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'V' has a circular constraint. interface I { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. interface I2 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'V' has a circular constraint. function f() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. function f2() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'V' has a circular constraint. var a: { (): void; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. (): void; - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'V' has a circular constraint. } var b = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. var b2 = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'U' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'V' has a circular constraint. class D { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. \ No newline at end of file + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. + ~ +!!! error TS2313: Type parameter 'V' has a circular constraint. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterOrderReversal.errors.txt b/tests/baselines/reference/typeParameterOrderReversal.errors.txt deleted file mode 100644 index cb404c8e71390..0000000000000 --- a/tests/baselines/reference/typeParameterOrderReversal.errors.txt +++ /dev/null @@ -1,22 +0,0 @@ -tests/cases/compiler/typeParameterOrderReversal.ts(6,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/typeParameterOrderReversal.ts(7,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/compiler/typeParameterOrderReversal.ts (2 errors) ==== - interface X { - n: T; - } - - // Only difference here is order of type parameters - function uFirst, T>(x: U) { } - ~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function tFirst>(x: U) { } - ~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var z: X = null; - - // Both of these should be allowed - uFirst(z); - tFirst(z); - \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterOrderReversal.symbols b/tests/baselines/reference/typeParameterOrderReversal.symbols new file mode 100644 index 0000000000000..6b17ac1da55df --- /dev/null +++ b/tests/baselines/reference/typeParameterOrderReversal.symbols @@ -0,0 +1,42 @@ +=== tests/cases/compiler/typeParameterOrderReversal.ts === +interface X { +>X : Symbol(X, Decl(typeParameterOrderReversal.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterOrderReversal.ts, 0, 12)) + + n: T; +>n : Symbol(n, Decl(typeParameterOrderReversal.ts, 0, 16)) +>T : Symbol(T, Decl(typeParameterOrderReversal.ts, 0, 12)) +} + +// Only difference here is order of type parameters +function uFirst, T>(x: U) { } +>uFirst : Symbol(uFirst, Decl(typeParameterOrderReversal.ts, 2, 1)) +>U : Symbol(U, Decl(typeParameterOrderReversal.ts, 5, 16)) +>X : Symbol(X, Decl(typeParameterOrderReversal.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterOrderReversal.ts, 5, 31)) +>T : Symbol(T, Decl(typeParameterOrderReversal.ts, 5, 31)) +>x : Symbol(x, Decl(typeParameterOrderReversal.ts, 5, 35)) +>U : Symbol(U, Decl(typeParameterOrderReversal.ts, 5, 16)) + +function tFirst>(x: U) { } +>tFirst : Symbol(tFirst, Decl(typeParameterOrderReversal.ts, 5, 44)) +>T : Symbol(T, Decl(typeParameterOrderReversal.ts, 6, 16)) +>U : Symbol(U, Decl(typeParameterOrderReversal.ts, 6, 18)) +>X : Symbol(X, Decl(typeParameterOrderReversal.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterOrderReversal.ts, 6, 16)) +>x : Symbol(x, Decl(typeParameterOrderReversal.ts, 6, 35)) +>U : Symbol(U, Decl(typeParameterOrderReversal.ts, 6, 18)) + +var z: X = null; +>z : Symbol(z, Decl(typeParameterOrderReversal.ts, 7, 3)) +>X : Symbol(X, Decl(typeParameterOrderReversal.ts, 0, 0)) + +// Both of these should be allowed +uFirst(z); +>uFirst : Symbol(uFirst, Decl(typeParameterOrderReversal.ts, 2, 1)) +>z : Symbol(z, Decl(typeParameterOrderReversal.ts, 7, 3)) + +tFirst(z); +>tFirst : Symbol(tFirst, Decl(typeParameterOrderReversal.ts, 5, 44)) +>z : Symbol(z, Decl(typeParameterOrderReversal.ts, 7, 3)) + diff --git a/tests/baselines/reference/typeParameterOrderReversal.types b/tests/baselines/reference/typeParameterOrderReversal.types new file mode 100644 index 0000000000000..9b09ea5d6c90a --- /dev/null +++ b/tests/baselines/reference/typeParameterOrderReversal.types @@ -0,0 +1,45 @@ +=== tests/cases/compiler/typeParameterOrderReversal.ts === +interface X { +>X : X +>T : T + + n: T; +>n : T +>T : T +} + +// Only difference here is order of type parameters +function uFirst, T>(x: U) { } +>uFirst : , T>(x: U) => void +>U : U +>X : X +>T : T +>T : T +>x : U +>U : U + +function tFirst>(x: U) { } +>tFirst : >(x: U) => void +>T : T +>U : U +>X : X +>T : T +>x : U +>U : U + +var z: X = null; +>z : X +>X : X +>null : null + +// Both of these should be allowed +uFirst(z); +>uFirst(z) : void +>uFirst : , T>(x: U) => void +>z : X + +tFirst(z); +>tFirst(z) : void +>tFirst : >(x: U) => void +>z : X + diff --git a/tests/baselines/reference/typeParameterUsedAsConstraint.errors.txt b/tests/baselines/reference/typeParameterUsedAsConstraint.errors.txt deleted file mode 100644 index c38900ca00c91..0000000000000 --- a/tests/baselines/reference/typeParameterUsedAsConstraint.errors.txt +++ /dev/null @@ -1,158 +0,0 @@ -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(1,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(2,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(3,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(4,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(5,10): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(5,23): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(6,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(6,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(8,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(9,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(10,30): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(11,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(12,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(12,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(13,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(13,30): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(15,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(16,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(17,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(18,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(19,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(19,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(20,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(20,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(22,13): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(23,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(24,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(25,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(26,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(26,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(27,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(27,27): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(29,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(30,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(31,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(32,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(33,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(33,25): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(34,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts(34,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts (40 errors) ==== - class C { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - class C2 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - class C3 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - class C4 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - class C5 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - class C6 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - interface I { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - interface I2 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - interface I3 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - interface I4 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - interface I5 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - interface I6 { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - function f() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function f2() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function f3() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function f4() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function f5() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function f6() { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - var e = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var e2 = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var e3 = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var e4 = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var e5 = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var e6 = () => { } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - var a: { (): void } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var a2: { (): void } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var a3: { (): void } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var a4: { (): void } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var a5: { (): void } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - var a6: { (): void } - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterUsedAsConstraint.symbols b/tests/baselines/reference/typeParameterUsedAsConstraint.symbols new file mode 100644 index 0000000000000..0b031742e75b5 --- /dev/null +++ b/tests/baselines/reference/typeParameterUsedAsConstraint.symbols @@ -0,0 +1,211 @@ +=== tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts === +class C { } +>C : Symbol(C, Decl(typeParameterUsedAsConstraint.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 0, 8)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 0, 10)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 0, 8)) + +class C2 { } +>C2 : Symbol(C2, Decl(typeParameterUsedAsConstraint.ts, 0, 27)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 1, 9)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 1, 21)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 1, 21)) + +class C3 { } +>C3 : Symbol(C3, Decl(typeParameterUsedAsConstraint.ts, 1, 28)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 2, 9)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 2, 24)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 2, 9)) + +class C4 { } +>C4 : Symbol(C4, Decl(typeParameterUsedAsConstraint.ts, 2, 41)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 3, 9)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 3, 21)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 3, 21)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +class C5 { } +>C5 : Symbol(C5, Decl(typeParameterUsedAsConstraint.ts, 3, 41)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 4, 9)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 4, 21)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 4, 21)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 4, 34)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 4, 34)) + +class C6 { } +>C6 : Symbol(C6, Decl(typeParameterUsedAsConstraint.ts, 4, 41)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 5, 9)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 5, 11)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 5, 9)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 5, 24)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 5, 11)) + +interface I { } +>I : Symbol(I, Decl(typeParameterUsedAsConstraint.ts, 5, 41)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 7, 12)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 7, 14)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 7, 12)) + +interface I2 { } +>I2 : Symbol(I2, Decl(typeParameterUsedAsConstraint.ts, 7, 31)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 8, 13)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 8, 25)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 8, 25)) + +interface I3 { } +>I3 : Symbol(I3, Decl(typeParameterUsedAsConstraint.ts, 8, 32)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 9, 13)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 9, 28)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 9, 13)) + +interface I4 { } +>I4 : Symbol(I4, Decl(typeParameterUsedAsConstraint.ts, 9, 45)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 10, 13)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 10, 25)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 10, 25)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +interface I5 { } +>I5 : Symbol(I5, Decl(typeParameterUsedAsConstraint.ts, 10, 45)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 11, 13)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 11, 25)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 11, 25)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 11, 38)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 11, 38)) + +interface I6 { } +>I6 : Symbol(I6, Decl(typeParameterUsedAsConstraint.ts, 11, 45)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 12, 13)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 12, 15)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 12, 13)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 12, 28)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 12, 15)) + +function f() { } +>f : Symbol(f, Decl(typeParameterUsedAsConstraint.ts, 12, 45)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 14, 11)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 14, 13)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 14, 11)) + +function f2() { } +>f2 : Symbol(f2, Decl(typeParameterUsedAsConstraint.ts, 14, 32)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 15, 12)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 15, 24)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 15, 24)) + +function f3() { } +>f3 : Symbol(f3, Decl(typeParameterUsedAsConstraint.ts, 15, 33)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 16, 12)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 16, 27)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 16, 12)) + +function f4() { } +>f4 : Symbol(f4, Decl(typeParameterUsedAsConstraint.ts, 16, 46)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 17, 12)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 17, 24)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 17, 24)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +function f5() { } +>f5 : Symbol(f5, Decl(typeParameterUsedAsConstraint.ts, 17, 46)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 18, 12)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 18, 24)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 18, 24)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 18, 37)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 18, 37)) + +function f6() { } +>f6 : Symbol(f6, Decl(typeParameterUsedAsConstraint.ts, 18, 46)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 19, 12)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 19, 14)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 19, 12)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 19, 27)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 19, 14)) + +var e = () => { } +>e : Symbol(e, Decl(typeParameterUsedAsConstraint.ts, 21, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 21, 9)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 21, 11)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 21, 9)) + +var e2 = () => { } +>e2 : Symbol(e2, Decl(typeParameterUsedAsConstraint.ts, 22, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 22, 10)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 22, 22)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 22, 22)) + +var e3 = () => { } +>e3 : Symbol(e3, Decl(typeParameterUsedAsConstraint.ts, 23, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 23, 10)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 23, 25)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 23, 10)) + +var e4 = () => { } +>e4 : Symbol(e4, Decl(typeParameterUsedAsConstraint.ts, 24, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 24, 10)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 24, 22)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 24, 22)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +var e5 = () => { } +>e5 : Symbol(e5, Decl(typeParameterUsedAsConstraint.ts, 25, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 25, 10)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 25, 22)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 25, 22)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 25, 35)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 25, 35)) + +var e6 = () => { } +>e6 : Symbol(e6, Decl(typeParameterUsedAsConstraint.ts, 26, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 26, 10)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 26, 12)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 26, 10)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 26, 25)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 26, 12)) + +var a: { (): void } +>a : Symbol(a, Decl(typeParameterUsedAsConstraint.ts, 28, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 28, 10)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 28, 12)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 28, 10)) + +var a2: { (): void } +>a2 : Symbol(a2, Decl(typeParameterUsedAsConstraint.ts, 29, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 29, 11)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 29, 23)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 29, 23)) + +var a3: { (): void } +>a3 : Symbol(a3, Decl(typeParameterUsedAsConstraint.ts, 30, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 30, 11)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 30, 26)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 30, 11)) + +var a4: { (): void } +>a4 : Symbol(a4, Decl(typeParameterUsedAsConstraint.ts, 31, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 31, 11)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 31, 23)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 31, 23)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +var a5: { (): void } +>a5 : Symbol(a5, Decl(typeParameterUsedAsConstraint.ts, 32, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 32, 11)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 32, 23)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 32, 23)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 32, 36)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 32, 36)) + +var a6: { (): void } +>a6 : Symbol(a6, Decl(typeParameterUsedAsConstraint.ts, 33, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 33, 11)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 33, 13)) +>T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 33, 11)) +>V : Symbol(V, Decl(typeParameterUsedAsConstraint.ts, 33, 26)) +>U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 33, 13)) + diff --git a/tests/baselines/reference/typeParameterUsedAsConstraint.types b/tests/baselines/reference/typeParameterUsedAsConstraint.types new file mode 100644 index 0000000000000..347eeed90093f --- /dev/null +++ b/tests/baselines/reference/typeParameterUsedAsConstraint.types @@ -0,0 +1,217 @@ +=== tests/cases/conformance/types/typeParameters/typeParameterLists/typeParameterUsedAsConstraint.ts === +class C { } +>C : C +>T : T +>U : U +>T : T + +class C2 { } +>C2 : C2 +>T : T +>U : U +>U : U + +class C3 { } +>C3 : C3 +>T : T +>Date : Date +>U : U +>T : T + +class C4 { } +>C4 : C4 +>T : T +>U : U +>U : U +>Date : Date + +class C5 { } +>C5 : C5 +>T : T +>U : U +>U : U +>V : V +>V : V + +class C6 { } +>C6 : C6 +>T : T +>U : U +>T : T +>V : V +>U : U + +interface I { } +>I : I +>T : T +>U : U +>T : T + +interface I2 { } +>I2 : I2 +>T : T +>U : U +>U : U + +interface I3 { } +>I3 : I3 +>T : T +>Date : Date +>U : U +>T : T + +interface I4 { } +>I4 : I4 +>T : T +>U : U +>U : U +>Date : Date + +interface I5 { } +>I5 : I5 +>T : T +>U : U +>U : U +>V : V +>V : V + +interface I6 { } +>I6 : I6 +>T : T +>U : U +>T : T +>V : V +>U : U + +function f() { } +>f : () => void +>T : T +>U : U +>T : T + +function f2() { } +>f2 : () => void +>T : T +>U : U +>U : U + +function f3() { } +>f3 : () => void +>T : T +>Date : Date +>U : U +>T : T + +function f4() { } +>f4 : () => void +>T : T +>U : U +>U : U +>Date : Date + +function f5() { } +>f5 : () => void +>T : T +>U : U +>U : U +>V : V +>V : V + +function f6() { } +>f6 : () => void +>T : T +>U : U +>T : T +>V : V +>U : U + +var e = () => { } +>e : () => void +>() => { } : () => void +>T : T +>U : U +>T : T + +var e2 = () => { } +>e2 : () => void +>() => { } : () => void +>T : T +>U : U +>U : U + +var e3 = () => { } +>e3 : () => void +>() => { } : () => void +>T : T +>Date : Date +>U : U +>T : T + +var e4 = () => { } +>e4 : () => void +>() => { } : () => void +>T : T +>U : U +>U : U +>Date : Date + +var e5 = () => { } +>e5 : () => void +>() => { } : () => void +>T : T +>U : U +>U : U +>V : V +>V : V + +var e6 = () => { } +>e6 : () => void +>() => { } : () => void +>T : T +>U : U +>T : T +>V : V +>U : U + +var a: { (): void } +>a : () => void +>T : T +>U : U +>T : T + +var a2: { (): void } +>a2 : () => void +>T : T +>U : U +>U : U + +var a3: { (): void } +>a3 : () => void +>T : T +>Date : Date +>U : U +>T : T + +var a4: { (): void } +>a4 : () => void +>T : T +>U : U +>U : U +>Date : Date + +var a5: { (): void } +>a5 : () => void +>T : T +>U : U +>U : U +>V : V +>V : V + +var a6: { (): void } +>a6 : () => void +>T : T +>U : U +>T : T +>V : V +>U : U + diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt deleted file mode 100644 index 9860b9ac59f0c..0000000000000 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.errors.txt +++ /dev/null @@ -1,88 +0,0 @@ -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(3,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(4,5): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(5,12): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(8,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(9,5): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(10,12): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(13,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(14,5): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(15,12): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(18,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(19,5): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(20,12): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(23,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(24,5): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(25,12): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(28,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(29,5): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts(30,12): error TS2322: Type 'U' is not assignable to type 'T'. - - -==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts (18 errors) ==== - // Type parameters are in scope in their own and other type parameter lists - - function foo(x: T, y: U): T { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - - function foo2(x: T, y: U): T { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - - var f = function (x: T, y: U): T { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - - var f2 = function (x: T, y: U): T { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - - var f3 = (x: T, y: U): T => { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - - var f4 = (x: T, y: U): T => { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.symbols b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.symbols new file mode 100644 index 0000000000000..52ec3d2e29d94 --- /dev/null +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.symbols @@ -0,0 +1,116 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts === +// Type parameters are in scope in their own and other type parameter lists + +function foo(x: T, y: U): T { +>foo : Symbol(foo, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 13)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 15)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 13)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 29)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 13)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 34)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 15)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 13)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 29)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 34)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 2, 34)) +} + +function foo2(x: T, y: U): T { +>foo2 : Symbol(foo2, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 5, 1)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 14)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 26)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 26)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 30)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 26)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 35)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 14)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 26)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 30)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 35)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 7, 35)) +} + +var f = function (x: T, y: U): T { +>f : Symbol(f, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 18)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 20)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 18)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 34)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 18)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 39)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 20)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 18)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 34)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 39)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 12, 39)) +} + +var f2 = function (x: T, y: U): T { +>f2 : Symbol(f2, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 3)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 19)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 31)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 31)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 35)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 31)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 40)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 19)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 31)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 35)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 40)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 17, 40)) +} + +var f3 = (x: T, y: U): T => { +>f3 : Symbol(f3, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 10)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 12)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 10)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 26)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 10)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 31)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 12)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 10)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 26)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 31)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 22, 31)) +} + +var f4 = (x: T, y: U): T => { +>f4 : Symbol(f4, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 3)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 10)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 22)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 22)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 26)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 22)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 31)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 10)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 22)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 26)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 31)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint.ts, 27, 31)) +} diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.types b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.types new file mode 100644 index 0000000000000..4b4a05c9e02b8 --- /dev/null +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint.types @@ -0,0 +1,126 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint.ts === +// Type parameters are in scope in their own and other type parameter lists + +function foo(x: T, y: U): T { +>foo : (x: T, y: U) => T +>T : T +>U : U +>T : T +>x : T +>T : T +>y : U +>U : U +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U +} + +function foo2(x: T, y: U): T { +>foo2 : (x: T, y: U) => T +>U : U +>T : T +>T : T +>x : T +>T : T +>y : U +>U : U +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U +} + +var f = function (x: T, y: U): T { +>f : (x: T, y: U) => T +>function (x: T, y: U): T { x = y; return y;} : (x: T, y: U) => T +>T : T +>U : U +>T : T +>x : T +>T : T +>y : U +>U : U +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U +} + +var f2 = function (x: T, y: U): T { +>f2 : (x: T, y: U) => T +>function (x: T, y: U): T { x = y; return y;} : (x: T, y: U) => T +>U : U +>T : T +>T : T +>x : T +>T : T +>y : U +>U : U +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U +} + +var f3 = (x: T, y: U): T => { +>f3 : (x: T, y: U) => T +>(x: T, y: U): T => { x = y; return y;} : (x: T, y: U) => T +>T : T +>U : U +>T : T +>x : T +>T : T +>y : U +>U : U +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U +} + +var f4 = (x: T, y: U): T => { +>f4 : (x: T, y: U) => T +>(x: T, y: U): T => { x = y; return y;} : (x: T, y: U) => T +>U : U +>T : T +>T : T +>x : T +>T : T +>y : U +>U : U +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U +} diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt deleted file mode 100644 index 12b90ac8525f3..0000000000000 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.errors.txt +++ /dev/null @@ -1,113 +0,0 @@ -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(4,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(7,13): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(8,20): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(13,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(16,13): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(17,20): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(22,22): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(25,13): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(26,20): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(31,20): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(34,13): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(35,20): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(40,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(43,13): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(44,20): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(49,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(52,13): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts(53,20): error TS2322: Type 'U' is not assignable to type 'T'. - - -==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts (18 errors) ==== - // Type parameters are in scope in their own and other type parameter lists - // Nested local functions - - function foo(x: T, y: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function bar() { - function baz(a: X, b: Y): T { - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - } - } - - function foo2(x: T, y: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function bar() { - function baz(a: X, b: Y): T { - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - } - } - - var f = function (x: T, y: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function bar() { - var g = function (a: X, b: Y): T { - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - } - } - - var f2 = function (x: T, y: U) { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function bar() { - var g = function baz(a: X, b: Y): T { - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - } - } - - var f3 = (x: T, y: U) => { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function bar() { - var g = (a: X, b: Y): T => { - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - } - } - - var f4 = (x: T, y: U) => { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - function bar() { - var g = (a: X, b: Y): T => { - x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.symbols b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.symbols new file mode 100644 index 0000000000000..3f19ef8c5f14e --- /dev/null +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.symbols @@ -0,0 +1,238 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts === +// Type parameters are in scope in their own and other type parameter lists +// Nested local functions + +function foo(x: T, y: U) { +>foo : Symbol(foo, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 0, 0)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 13)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 15)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 13)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 29)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 13)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 34)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 15)) + + function bar() { +>bar : Symbol(bar, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 42)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 4, 17)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 13)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 4, 29)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 15)) + + function baz(a: X, b: Y): T { +>baz : Symbol(baz, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 4, 46)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 5, 21)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 4, 29)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 5, 33)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 4, 17)) +>a : Symbol(a, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 5, 47)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 5, 21)) +>b : Symbol(b, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 5, 52)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 5, 33)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 13)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 29)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 34)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 3, 34)) + } + } +} + +function foo2(x: T, y: U) { +>foo2 : Symbol(foo2, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 10, 1)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 14)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 26)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 26)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 30)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 26)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 35)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 14)) + + function bar() { +>bar : Symbol(bar, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 43)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 13, 17)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 26)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 13, 29)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 14)) + + function baz(a: X, b: Y): T { +>baz : Symbol(baz, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 13, 46)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 14, 21)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 13, 29)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 14, 33)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 13, 17)) +>a : Symbol(a, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 14, 47)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 14, 21)) +>b : Symbol(b, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 14, 52)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 14, 33)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 26)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 30)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 35)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 12, 35)) + } + } +} + +var f = function (x: T, y: U) { +>f : Symbol(f, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 18)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 20)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 18)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 34)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 18)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 39)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 20)) + + function bar() { +>bar : Symbol(bar, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 47)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 22, 17)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 18)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 22, 29)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 20)) + + var g = function (a: X, b: Y): T { +>g : Symbol(g, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 23, 11)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 23, 26)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 22, 29)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 23, 38)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 22, 17)) +>a : Symbol(a, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 23, 52)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 23, 26)) +>b : Symbol(b, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 23, 57)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 23, 38)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 18)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 34)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 39)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 21, 39)) + } + } +} + +var f2 = function (x: T, y: U) { +>f2 : Symbol(f2, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 3)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 19)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 31)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 31)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 35)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 31)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 40)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 19)) + + function bar() { +>bar : Symbol(bar, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 48)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 31, 17)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 31)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 31, 29)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 19)) + + var g = function baz(a: X, b: Y): T { +>g : Symbol(g, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 32, 11)) +>baz : Symbol(baz, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 32, 15)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 32, 29)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 31, 29)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 32, 41)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 31, 17)) +>a : Symbol(a, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 32, 55)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 32, 29)) +>b : Symbol(b, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 32, 60)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 32, 41)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 31)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 35)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 40)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 30, 40)) + } + } +} + +var f3 = (x: T, y: U) => { +>f3 : Symbol(f3, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 3)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 10)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 12)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 10)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 26)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 10)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 31)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 12)) + + function bar() { +>bar : Symbol(bar, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 42)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 40, 17)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 10)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 40, 29)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 12)) + + var g = (a: X, b: Y): T => { +>g : Symbol(g, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 41, 11)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 41, 17)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 40, 29)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 41, 29)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 40, 17)) +>a : Symbol(a, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 41, 43)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 41, 17)) +>b : Symbol(b, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 41, 48)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 41, 29)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 10)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 26)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 31)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 39, 31)) + } + } +} + +var f4 = (x: T, y: U) => { +>f4 : Symbol(f4, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 3)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 10)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 22)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 22)) +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 26)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 22)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 31)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 10)) + + function bar() { +>bar : Symbol(bar, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 42)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 49, 17)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 22)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 49, 29)) +>U : Symbol(U, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 10)) + + var g = (a: X, b: Y): T => { +>g : Symbol(g, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 50, 11)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 50, 17)) +>W : Symbol(W, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 49, 29)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 50, 29)) +>V : Symbol(V, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 49, 17)) +>a : Symbol(a, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 50, 43)) +>X : Symbol(X, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 50, 17)) +>b : Symbol(b, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 50, 48)) +>Y : Symbol(Y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 50, 29)) +>T : Symbol(T, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 22)) + + x = y; +>x : Symbol(x, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 26)) +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 31)) + + return y; +>y : Symbol(y, Decl(typeParameterUsedAsTypeParameterConstraint2.ts, 48, 31)) + } + } +} diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.types b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.types new file mode 100644 index 0000000000000..d1e3828a2e1d2 --- /dev/null +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint2.types @@ -0,0 +1,252 @@ +=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint2.ts === +// Type parameters are in scope in their own and other type parameter lists +// Nested local functions + +function foo(x: T, y: U) { +>foo : (x: T, y: U) => void +>T : T +>U : U +>T : T +>x : T +>T : T +>y : U +>U : U + + function bar() { +>bar : () => void +>V : V +>T : T +>W : W +>U : U + + function baz(a: X, b: Y): T { +>baz : (a: X, b: Y) => T +>X : X +>W : W +>Y : Y +>V : V +>a : X +>X : X +>b : Y +>Y : Y +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U + } + } +} + +function foo2(x: T, y: U) { +>foo2 : (x: T, y: U) => void +>U : U +>T : T +>T : T +>x : T +>T : T +>y : U +>U : U + + function bar() { +>bar : () => void +>V : V +>T : T +>W : W +>U : U + + function baz(a: X, b: Y): T { +>baz : (a: X, b: Y) => T +>X : X +>W : W +>Y : Y +>V : V +>a : X +>X : X +>b : Y +>Y : Y +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U + } + } +} + +var f = function (x: T, y: U) { +>f : (x: T, y: U) => void +>function (x: T, y: U) { function bar() { var g = function (a: X, b: Y): T { x = y; return y; } }} : (x: T, y: U) => void +>T : T +>U : U +>T : T +>x : T +>T : T +>y : U +>U : U + + function bar() { +>bar : () => void +>V : V +>T : T +>W : W +>U : U + + var g = function (a: X, b: Y): T { +>g : (a: X, b: Y) => T +>function (a: X, b: Y): T { x = y; return y; } : (a: X, b: Y) => T +>X : X +>W : W +>Y : Y +>V : V +>a : X +>X : X +>b : Y +>Y : Y +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U + } + } +} + +var f2 = function (x: T, y: U) { +>f2 : (x: T, y: U) => void +>function (x: T, y: U) { function bar() { var g = function baz(a: X, b: Y): T { x = y; return y; } }} : (x: T, y: U) => void +>U : U +>T : T +>T : T +>x : T +>T : T +>y : U +>U : U + + function bar() { +>bar : () => void +>V : V +>T : T +>W : W +>U : U + + var g = function baz(a: X, b: Y): T { +>g : (a: X, b: Y) => T +>function baz(a: X, b: Y): T { x = y; return y; } : (a: X, b: Y) => T +>baz : (a: X, b: Y) => T +>X : X +>W : W +>Y : Y +>V : V +>a : X +>X : X +>b : Y +>Y : Y +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U + } + } +} + +var f3 = (x: T, y: U) => { +>f3 : (x: T, y: U) => void +>(x: T, y: U) => { function bar() { var g = (a: X, b: Y): T => { x = y; return y; } }} : (x: T, y: U) => void +>T : T +>U : U +>T : T +>x : T +>T : T +>y : U +>U : U + + function bar() { +>bar : () => void +>V : V +>T : T +>W : W +>U : U + + var g = (a: X, b: Y): T => { +>g : (a: X, b: Y) => T +>(a: X, b: Y): T => { x = y; return y; } : (a: X, b: Y) => T +>X : X +>W : W +>Y : Y +>V : V +>a : X +>X : X +>b : Y +>Y : Y +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U + } + } +} + +var f4 = (x: T, y: U) => { +>f4 : (x: T, y: U) => void +>(x: T, y: U) => { function bar() { var g = (a: X, b: Y): T => { x = y; return y; } }} : (x: T, y: U) => void +>U : U +>T : T +>T : T +>x : T +>T : T +>y : U +>U : U + + function bar() { +>bar : () => void +>V : V +>T : T +>W : W +>U : U + + var g = (a: X, b: Y): T => { +>g : (a: X, b: Y) => T +>(a: X, b: Y): T => { x = y; return y; } : (a: X, b: Y) => T +>X : X +>W : W +>Y : Y +>V : V +>a : X +>X : X +>b : Y +>Y : Y +>T : T + + x = y; +>x = y : U +>x : T +>y : U + + return y; +>y : U + } + } +} diff --git a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt index d78faf74fab91..1898310775750 100644 --- a/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt +++ b/tests/baselines/reference/typeParameterUsedAsTypeParameterConstraint4.errors.txt @@ -1,57 +1,30 @@ -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(4,12): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(4,25): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(5,8): error TS2304: Cannot find name 'W'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(8,16): error TS2322: Type 'W' is not assignable to type 'T'. - Type 'V' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(12,16): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(12,29): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(15,8): error TS2304: Cannot find name 'W'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(19,17): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(19,43): error TS2304: Cannot find name 'V'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(20,47): error TS2304: Cannot find name 'X'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(22,13): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(23,20): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,15): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(28,44): error TS2304: Cannot find name 'W'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(29,47): error TS2304: Cannot find name 'Y'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(31,13): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(32,20): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(37,14): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(38,47): error TS2304: Cannot find name 'X'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(38,53): error TS2304: Cannot find name 'Y'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(40,13): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(41,20): error TS2322: Type 'U' is not assignable to type 'T'. -tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,11): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,30): error TS2304: Cannot find name 'V'. tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts(46,36): error TS2304: Cannot find name 'X'. -==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts (25 errors) ==== +==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsedAsTypeParameterConstraint4.ts (10 errors) ==== // Type parameters are in scope in their own and other type parameter lists // Some negative cases class C { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. z: W; // error ~ !!! error TS2304: Cannot find name 'W'. foo(x: W): T { var r: T; return x; - ~ -!!! error TS2322: Type 'W' is not assignable to type 'T'. -!!! error TS2322: Type 'V' is not assignable to type 'T'. } } interface I { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. x: T; y: U; z: W; // error @@ -61,8 +34,6 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed } function foo(x: T, y: U): V { // error - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~ !!! error TS2304: Cannot find name 'V'. function bar(): X { // error @@ -70,18 +41,12 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2304: Cannot find name 'X'. function baz(a: X, b: Y): T { x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } function foo2(x: T, y: U): W { // error - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~ !!! error TS2304: Cannot find name 'W'. function bar(): Y { // error @@ -89,18 +54,12 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2304: Cannot find name 'Y'. function baz(a: X, b: Y): T { x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } var f3 = (x: T, y: U) => { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. function bar(r: X, s: Y) { // error ~ !!! error TS2304: Cannot find name 'X'. @@ -108,18 +67,12 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/typeParameterUsed !!! error TS2304: Cannot find name 'Y'. var g = (a: X, b: Y): T => { x = y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. return y; - ~ -!!! error TS2322: Type 'U' is not assignable to type 'T'. } } } var f4 = (x: V, y: X) => { // error - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. ~ !!! error TS2304: Cannot find name 'V'. ~ diff --git a/tests/baselines/reference/typeParameterWithInvalidConstraintType.errors.txt b/tests/baselines/reference/typeParameterWithInvalidConstraintType.errors.txt index 8201f752e5120..79af423f91753 100644 --- a/tests/baselines/reference/typeParameterWithInvalidConstraintType.errors.txt +++ b/tests/baselines/reference/typeParameterWithInvalidConstraintType.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/typeParameterWithInvalidConstraintType.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. +tests/cases/compiler/typeParameterWithInvalidConstraintType.ts(1,19): error TS2313: Type parameter 'T' has a circular constraint. ==== tests/cases/compiler/typeParameterWithInvalidConstraintType.ts (1 errors) ==== class A { - ~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. + ~ +!!! error TS2313: Type parameter 'T' has a circular constraint. foo() { var x: T; // no error expected below this line diff --git a/tests/baselines/reference/unspecializedConstraints.errors.txt b/tests/baselines/reference/unspecializedConstraints.errors.txt index fc840f328dfb0..a049e508f8074 100644 --- a/tests/baselines/reference/unspecializedConstraints.errors.txt +++ b/tests/baselines/reference/unspecializedConstraints.errors.txt @@ -1,10 +1,7 @@ tests/cases/compiler/unspecializedConstraints.ts(84,44): error TS2304: Cannot find name 'TypeParameter'. -tests/cases/compiler/unspecializedConstraints.ts(127,28): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/unspecializedConstraints.ts(135,26): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -tests/cases/compiler/unspecializedConstraints.ts(144,24): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. -==== tests/cases/compiler/unspecializedConstraints.ts (4 errors) ==== +==== tests/cases/compiler/unspecializedConstraints.ts (1 errors) ==== module ts { interface Map { [index: string]: T; @@ -134,8 +131,6 @@ tests/cases/compiler/unspecializedConstraints.ts(144,24): error TS2313: Constrai } function arrayContains>(a: T[], item: T): boolean { - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var len = a.length; for (var i = 0; i < len; i++) { if (item.equals(a[i])) return true; @@ -144,8 +139,6 @@ tests/cases/compiler/unspecializedConstraints.ts(144,24): error TS2313: Constrai } function arrayEquals>(a: T[], b: T[]): boolean { - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var len = a.length; if (b.length !== len) return false; for (var i = 0; i < len; i++) { @@ -155,8 +148,6 @@ tests/cases/compiler/unspecializedConstraints.ts(144,24): error TS2313: Constrai } function setEquals>(a: T[], b: T[]): boolean { - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. var len = a.length; if (b.length !== len) return false; for (var i = 0; i < len; i++) { diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints2.errors.txt b/tests/baselines/reference/wrappedAndRecursiveConstraints2.errors.txt deleted file mode 100644 index 0a7bc52f9d2cd..0000000000000 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints2.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints2.ts(1,9): error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - - -==== tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints2.ts (1 errors) ==== - class C> { // error - ~~~~~~~~~~~~~~ -!!! error TS2313: Constraint of a type parameter cannot reference any type parameter from the same type parameter list. - constructor(x: T) { } - } - - var c = new C(1); - var c = new C(new C('')); // error \ No newline at end of file diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints2.symbols b/tests/baselines/reference/wrappedAndRecursiveConstraints2.symbols new file mode 100644 index 0000000000000..c359e5b0c4a69 --- /dev/null +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints2.symbols @@ -0,0 +1,21 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints2.ts === +class C> { // error +>C : Symbol(C, Decl(wrappedAndRecursiveConstraints2.ts, 0, 0)) +>T : Symbol(T, Decl(wrappedAndRecursiveConstraints2.ts, 0, 8)) +>C : Symbol(C, Decl(wrappedAndRecursiveConstraints2.ts, 0, 0)) +>T : Symbol(T, Decl(wrappedAndRecursiveConstraints2.ts, 0, 8)) + + constructor(x: T) { } +>x : Symbol(x, Decl(wrappedAndRecursiveConstraints2.ts, 1, 16)) +>T : Symbol(T, Decl(wrappedAndRecursiveConstraints2.ts, 0, 8)) +} + +var c = new C(1); +>c : Symbol(c, Decl(wrappedAndRecursiveConstraints2.ts, 4, 3), Decl(wrappedAndRecursiveConstraints2.ts, 5, 3)) +>C : Symbol(C, Decl(wrappedAndRecursiveConstraints2.ts, 0, 0)) + +var c = new C(new C('')); // error +>c : Symbol(c, Decl(wrappedAndRecursiveConstraints2.ts, 4, 3), Decl(wrappedAndRecursiveConstraints2.ts, 5, 3)) +>C : Symbol(C, Decl(wrappedAndRecursiveConstraints2.ts, 0, 0)) +>C : Symbol(C, Decl(wrappedAndRecursiveConstraints2.ts, 0, 0)) + diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints2.types b/tests/baselines/reference/wrappedAndRecursiveConstraints2.types new file mode 100644 index 0000000000000..479cac1d184f5 --- /dev/null +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints2.types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints2.ts === +class C> { // error +>C : C +>T : T +>C : C +>T : T + + constructor(x: T) { } +>x : T +>T : T +} + +var c = new C(1); +>c : C +>new C(1) : C +>C : typeof C +>1 : number + +var c = new C(new C('')); // error +>c : C +>new C(new C('')) : C> +>C : typeof C +>new C('') : C +>C : typeof C +>'' : string + diff --git a/tests/cases/compiler/declarationEmitFBoundedTypeParams.ts b/tests/cases/compiler/declarationEmitFBoundedTypeParams.ts new file mode 100644 index 0000000000000..baa91ab7bb2ec --- /dev/null +++ b/tests/cases/compiler/declarationEmitFBoundedTypeParams.ts @@ -0,0 +1,8 @@ +// @declaration: true + +// Repro from #6040 + +function append(result: a[], value: b): a[] { + result.push(value); + return result; +} diff --git a/tests/cases/compiler/typeInferenceFBoundedTypeParams.ts b/tests/cases/compiler/typeInferenceFBoundedTypeParams.ts new file mode 100644 index 0000000000000..26f6be3fad22b --- /dev/null +++ b/tests/cases/compiler/typeInferenceFBoundedTypeParams.ts @@ -0,0 +1,22 @@ +// Example from #6037 + +function fold(values: a[], result: r, fold: (result: r, value: a) => r): r { + for (let value of values) { + result = fold(result, value); + } + return result; +} + +function append(values: a[], value: b): a[] { + values.push(value); + return values; +} + +fold( + [1, 2, 3], + [] as [string, string][], + (result, value) => append( + result, + ["", ""] + ) +); diff --git a/tests/cases/compiler/typeParameterConstraintInstantiation.ts b/tests/cases/compiler/typeParameterConstraintInstantiation.ts new file mode 100644 index 0000000000000..f81ddaf89595e --- /dev/null +++ b/tests/cases/compiler/typeParameterConstraintInstantiation.ts @@ -0,0 +1,8 @@ +// Check that type parameter constraints are properly instantiated + +interface Mapper { + map(f: (item: T) => U): V; +} + +var m: Mapper; +var a = m.map((x: string) => x); // string[]