diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 83830e16eb2..2b205aaca60 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1392,7 +1392,7 @@ module ts { for (var i = 0; i < resolved.properties.length; i++) { var p = resolved.properties[i]; var t = getTypeOfSymbol(p); - if (p.flags & (SymbolFlags.Function | SymbolFlags.Method) && !isObjectLiteralMethod(p.valueDeclaration) && !getPropertiesOfObjectType(t).length) { + if (p.flags & (SymbolFlags.Function | SymbolFlags.Method) && !getPropertiesOfObjectType(t).length) { var signatures = getSignaturesOfType(t, SignatureKind.Call); for (var j = 0; j < signatures.length; j++) { buildSymbolDisplay(p, writer); @@ -2839,7 +2839,7 @@ module ts { // The expression is processed as an identifier expression (section 4.3) // or property access expression(section 4.10), // the widened type(section 3.9) of which becomes the result. - links.resolvedType = getWidenedType(checkExpression(node.exprName)); + links.resolvedType = getWidenedType(checkExpressionOrQualifiedName(node.exprName)); } return links.resolvedType; } @@ -3238,30 +3238,32 @@ module ts { return type; } + function isContextSensitiveExpression(node: Expression): boolean { + return isContextSensitiveCore(node); + } + // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. - function isContextSensitiveExpression(node: Node): boolean { + function isContextSensitiveCore(node: Expression | MethodDeclaration | PropertyAssignment): boolean { + Debug.assert(node.kind !== SyntaxKind.Method || isObjectLiteralMethod(node)); switch (node.kind) { case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: return isContextSensitiveFunctionLikeDeclaration(node); case SyntaxKind.ObjectLiteralExpression: - return forEach((node).properties, isContextSensitiveExpression); + return forEach((node).properties, isContextSensitiveCore); case SyntaxKind.ArrayLiteralExpression: - return forEach((node).elements, e => isContextSensitiveExpression(e)); + return forEach((node).elements, isContextSensitiveCore); case SyntaxKind.ConditionalExpression: - return isContextSensitiveExpression((node).whenTrue) || - isContextSensitiveExpression((node).whenFalse); + return isContextSensitiveCore((node).whenTrue) || + isContextSensitiveCore((node).whenFalse); case SyntaxKind.BinaryExpression: return (node).operator === SyntaxKind.BarBarToken && - (isContextSensitiveExpression((node).left) || isContextSensitiveExpression((node).right)); + (isContextSensitiveCore((node).left) || isContextSensitiveCore((node).right)); case SyntaxKind.LonghandPropertyAssignment: - return isContextSensitiveExpression((node).initializer); + return isContextSensitiveCore((node).initializer); case SyntaxKind.Method: - if (isObjectLiteralMethod(node)) { - return isContextSensitiveFunctionLikeDeclaration(node); - } - return false; + return isContextSensitiveFunctionLikeDeclaration(node); } return false; @@ -5115,7 +5117,7 @@ module ts { type = checkExpression((memberDecl).initializer, contextualMapper); } else if (memberDecl.kind === SyntaxKind.Method) { - type = checkExpression(memberDecl, contextualMapper); + type = checkObjectLiteralMethod(memberDecl, contextualMapper); } else { Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment); @@ -5233,7 +5235,7 @@ module ts { } function checkPropertyAccessExpressionOrQualifiedName(node: PropertyAccessExpression | QualifiedName, left: Expression | QualifiedName, right: Identifier) { - var type = checkExpression(left); + var type = checkExpressionOrQualifiedName(left); if (type === unknownType) return type; if (type !== anyType) { var apparentType = getApparentType(getWidenedType(type)); @@ -5274,7 +5276,7 @@ module ts { ? (node).expression : (node).left; - var type = checkExpression(left); + var type = checkExpressionOrQualifiedName(left); if (type !== unknownType && type !== anyType) { var prop = getPropertyOfType(getWidenedType(type), propertyName); if (prop && prop.parent && prop.parent.flags & SymbolFlags.Class) { @@ -6184,7 +6186,7 @@ module ts { links.flags |= NodeCheckFlags.ContextChecked; if (contextualSignature) { var signature = getSignaturesOfType(type, SignatureKind.Call)[0]; - if (isContextSensitiveExpression(node)) { + if (isContextSensitiveCore(node)) { assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); } if (!node.type) { @@ -6590,6 +6592,18 @@ module ts { return result; } + function checkExpressionOrQualifiedName(node: Expression | QualifiedName, contextualMapper?: TypeMapper): Type { + return checkExpressionCore(node, contextualMapper); + } + + function checkExpression(node: Expression, contextualMapper?: TypeMapper): Type { + return checkExpressionCore(node, contextualMapper); + } + + function checkObjectLiteralMethod(node: MethodDeclaration, contextualMapper?: TypeMapper): Type { + return checkExpressionCore(node, contextualMapper); + } + // Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When // contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the // expression is being inferentially typed (section 4.12.2 in spec) and provides the type mapper to use in @@ -6597,7 +6611,7 @@ module ts { // object, it serves as an indicator that all contained function and arrow expressions should be considered to // have the wildcard function type; this form of type check is used during overload resolution to exclude // contextually typed function and arrow expressions in the initial phase. - function checkExpression(node: Expression | QualifiedName | MethodDeclaration, contextualMapper?: TypeMapper): Type { + function checkExpressionCore(node: Expression | QualifiedName | MethodDeclaration, contextualMapper?: TypeMapper): Type { var type = checkExpressionOrQualifiedNameOrObjectLiteralMethodNode(node, contextualMapper); if (contextualMapper && contextualMapper !== identityMapper && node.kind !== SyntaxKind.QualifiedName) { var signature = getSingleCallSignature(type); @@ -7947,7 +7961,7 @@ module ts { } // Check that base type can be evaluated as expression - checkExpression(baseTypeNode.typeName); + checkExpressionOrQualifiedName(baseTypeNode.typeName); } var implementedTypeNodes = getClassImplementedTypeNodes(node); @@ -8436,7 +8450,7 @@ module ts { // ensure it can be evaluated as an expression var moduleName = getFirstIdentifier(node.moduleReference); if (resolveEntityName(node, moduleName, SymbolFlags.Value | SymbolFlags.Namespace).flags & SymbolFlags.Namespace) { - checkExpression(node.moduleReference); + checkExpressionOrQualifiedName(node.moduleReference); } else { error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName)); diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 4b7b276086f..6bfeb1dc2a6 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -102,12 +102,9 @@ module ts.BreakpointResolver { return spanInFunctionDeclaration(node); case SyntaxKind.Block: - if (isFunctionBlock(node)) { - return spanInFunctionBlock(node); - } - else { - return spanInBlock(node); - } + return isFunctionBlock(node) + ? spanInFunctionBlock(node) + : spanInBlock(node); case SyntaxKind.TryBlock: case SyntaxKind.FinallyBlock: diff --git a/tests/baselines/reference/assignEveryTypeToAny.types b/tests/baselines/reference/assignEveryTypeToAny.types index 8917ae22055..129440fa463 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.types +++ b/tests/baselines/reference/assignEveryTypeToAny.types @@ -132,15 +132,15 @@ x = i; >i : () => string x = { f() { return 1; } } ->x = { f() { return 1; } } : { f: () => number; } +>x = { f() { return 1; } } : { f(): number; } >x : any ->{ f() { return 1; } } : { f: () => number; } +>{ f() { return 1; } } : { f(): number; } >f : () => number x = { f(x: T) { return x; } } ->x = { f(x: T) { return x; } } : { f: (x: T) => T; } +>x = { f(x: T) { return x; } } : { f(x: T): T; } >x : any ->{ f(x: T) { return x; } } : { f: (x: T) => T; } +>{ f(x: T) { return x; } } : { f(x: T): T; } >f : (x: T) => T >T : T >x : T diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.types b/tests/baselines/reference/callSignaturesWithOptionalParameters.types index 49a94c3a6ed..818c52f79d0 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.types @@ -133,8 +133,8 @@ a.foo(1); >foo : (x?: number) => any var b = { ->b : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } ->{ foo(x?: number) { }, a: function foo(x: number, y?: number) { }, b: (x?: number) => { }} : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } +>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } +>{ foo(x?: number) { }, a: function foo(x: number, y?: number) { }, b: (x?: number) => { }} : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } foo(x?: number) { }, >foo : (x?: number) => void @@ -156,36 +156,36 @@ var b = { b.foo(); >b.foo() : void >b.foo : (x?: number) => void ->b : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } +>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >foo : (x?: number) => void b.foo(1); >b.foo(1) : void >b.foo : (x?: number) => void ->b : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } +>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >foo : (x?: number) => void b.a(1); >b.a(1) : void >b.a : (x: number, y?: number) => void ->b : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } +>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void b.a(1, 2); >b.a(1, 2) : void >b.a : (x: number, y?: number) => void ->b : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } +>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >a : (x: number, y?: number) => void b.b(); >b.b() : void >b.b : (x?: number) => void ->b : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } +>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >b : (x?: number) => void b.b(1); >b.b(1) : void >b.b : (x?: number) => void ->b : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } +>b : { foo(x?: number): void; a: (x: number, y?: number) => void; b: (x?: number) => void; } >b : (x?: number) => void diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.types b/tests/baselines/reference/commentsOnObjectLiteral3.types index 08dfd14cedb..e81bd646b5a 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3.types +++ b/tests/baselines/reference/commentsOnObjectLiteral3.types @@ -1,8 +1,8 @@ === tests/cases/compiler/commentsOnObjectLiteral3.ts === var v = { ->v : { prop: number; func: () => void; func1: () => void; a: any; } ->{ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, //property func: function () { }, //PropertyName + CallSignature func1() { }, //getter get a() { return this.prop; } /*trailing 1*/, //setter set a(value) { this.prop = value; } // trailing 2} : { prop: number; func: () => void; func1: () => void; a: any; } +>v : { prop: number; func: () => void; func1(): void; a: any; } +>{ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, //property func: function () { }, //PropertyName + CallSignature func1() { }, //getter get a() { return this.prop; } /*trailing 1*/, //setter set a(value) { this.prop = value; } // trailing 2} : { prop: number; func: () => void; func1(): void; a: any; } //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, diff --git a/tests/baselines/reference/invalidUndefinedValues.types b/tests/baselines/reference/invalidUndefinedValues.types index 3e3e08183c2..3f17deede37 100644 --- a/tests/baselines/reference/invalidUndefinedValues.types +++ b/tests/baselines/reference/invalidUndefinedValues.types @@ -68,9 +68,9 @@ x = M; >M : typeof M x = { f() { } } ->x = { f() { } } : { f: () => void; } +>x = { f() { } } : { f(): void; } >x : any ->{ f() { } } : { f: () => void; } +>{ f() { } } : { f(): void; } >f : () => void function f(a: T) { diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index 64decc2f5e2..9c6be972d3b 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -12,7 +12,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): e tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(26,1): error TS2322: Type 'typeof E' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(27,1): error TS2322: Type 'E' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): error TS2322: Type '{ f(): void; }' is not assignable to type 'void'. ==== tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts (13 errors) ==== @@ -72,4 +72,4 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e x = { f() { } } ~ -!!! error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. \ No newline at end of file +!!! error TS2322: Type '{ f(): void; }' is not assignable to type 'void'. \ No newline at end of file diff --git a/tests/baselines/reference/invalidVoidValues.errors.txt b/tests/baselines/reference/invalidVoidValues.errors.txt index b8a4400e4e0..eb5ddd02259 100644 --- a/tests/baselines/reference/invalidVoidValues.errors.txt +++ b/tests/baselines/reference/invalidVoidValues.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(7,1): error T tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(8,1): error TS2322: Type 'E' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(12,1): error TS2322: Type 'C' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(16,1): error TS2322: Type 'I' is not assignable to type 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(18,1): error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. +tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(18,1): error TS2322: Type '{ f(): void; }' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(21,1): error TS2322: Type 'typeof M' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(24,5): error TS2322: Type 'T' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,1): error TS2322: Type '(a: T) => void' is not assignable to type 'void'. @@ -45,7 +45,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidValues.ts(26,1): error x = { f() {} } ~ -!!! error TS2322: Type '{ f: () => void; }' is not assignable to type 'void'. +!!! error TS2322: Type '{ f(): void; }' is not assignable to type 'void'. module M { export var x = 1; } x = M; diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types index aad0fcc1df4..41bcdd99a71 100644 --- a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types +++ b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types @@ -3,8 +3,8 @@ var x = 1 >x : number var y = { x() { x++; } }; ->y : { x: () => void; } ->{ x() { x++; } } : { x: () => void; } +>y : { x(): void; } +>{ x() { x++; } } : { x(): void; } >x : () => void >x++ : number >x : number diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt index 19f2c700ccf..bd9a0bcbc93 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -7,7 +7,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(21,5): error TS2412: Property '3.0' of type 'MyNumber' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; }' is not assignable to type '{ [x: number]: string; }'. Index signatures are incompatible. Type 'string | number' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -108,7 +108,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo // error var b: { [x: number]: string; } = { ~ -!!! error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo: () => string; }' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2322: Type '{ [x: number]: string | number; 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; }' is not assignable to type '{ [x: number]: string; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'string | number' is not assignable to type 'string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/objectLiteralShorthandProperties.types b/tests/baselines/reference/objectLiteralShorthandProperties.types index c5b869d5a74..c34b2ab79b7 100644 --- a/tests/baselines/reference/objectLiteralShorthandProperties.types +++ b/tests/baselines/reference/objectLiteralShorthandProperties.types @@ -23,7 +23,7 @@ var x2 = { var x3 = { >x3 : any ->{ a: 0, b, c, d() { }, x3, parent: x3} : { a: number; b: any; c: any; d: () => void; x3: any; parent: any; } +>{ a: 0, b, c, d() { }, x3, parent: x3} : { a: number; b: any; c: any; d(): void; x3: any; parent: any; } a: 0, >a : number diff --git a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types index 5a85c17694f..5d5acc279a5 100644 --- a/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types +++ b/tests/baselines/reference/objectLiteralShorthandPropertiesES6.types @@ -23,7 +23,7 @@ var x2 = { var x3 = { >x3 : any ->{ a: 0, b, c, d() { }, x3, parent: x3} : { a: number; b: any; c: any; d: () => void; x3: any; parent: any; } +>{ a: 0, b, c, d() { }, x3, parent: x3} : { a: number; b: any; c: any; d(): void; x3: any; parent: any; } a: 0, >a : number diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types index 184683910af..efe7e32f5d7 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types @@ -53,8 +53,8 @@ var a: { foo(x: string): string } >x : string var b = { foo(x: string) { return ''; } }; ->b : { foo: (x: string) => string; } ->{ foo(x: string) { return ''; } } : { foo: (x: string) => string; } +>b : { foo(x: string): string; } +>{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string @@ -129,17 +129,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } ->x : { foo: (x: string) => string; } ->b : { foo: (x: string) => string; } +>foo4 : { (x: { foo(x: string): string; }): any; (x: { foo(x: string): string; }): any; } +>x : { foo(x: string): string; } +>b : { foo(x: string): string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } ->x : { foo: (x: string) => string; } ->b : { foo: (x: string) => string; } +>foo4 : { (x: { foo(x: string): string; }): any; (x: { foo(x: string): string; }): any; } +>x : { foo(x: string): string; } +>b : { foo(x: string): string; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } +>foo4 : { (x: { foo(x: string): string; }): any; (x: { foo(x: string): string; }): any; } >x : any function foo5(x: A); @@ -241,17 +241,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: string): string; }): any; } >x : B >B : B function foo11(x: typeof b); // error ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } ->x : { foo: (x: string) => string; } ->b : { foo: (x: string) => string; } +>foo11 : { (x: B): any; (x: { foo(x: string): string; }): any; } +>x : { foo(x: string): string; } +>b : { foo(x: string): string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: string): string; }): any; } >x : any function foo12(x: I); @@ -297,17 +297,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: string): string; }): any; } >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } ->x : { foo: (x: string) => string; } ->b : { foo: (x: string) => string; } +>foo14 : { (x: I): any; (x: { foo(x: string): string; }): any; } +>x : { foo(x: string): string; } +>b : { foo(x: string): string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: string): string; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types index 0143ae426f4..9004a267691 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types @@ -54,8 +54,8 @@ var a: { foo(x: Date): string } >Date : Date var b = { foo(x: RegExp) { return ''; } }; ->b : { foo: (x: RegExp) => string; } ->{ foo(x: RegExp) { return ''; } } : { foo: (x: RegExp) => string; } +>b : { foo(x: RegExp): string; } +>{ foo(x: RegExp) { return ''; } } : { foo(x: RegExp): string; } >foo : (x: RegExp) => string >x : RegExp >RegExp : RegExp @@ -131,17 +131,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: RegExp) => string; }): any; (x: { foo: (x: RegExp) => string; }): any; } ->x : { foo: (x: RegExp) => string; } ->b : { foo: (x: RegExp) => string; } +>foo4 : { (x: { foo(x: RegExp): string; }): any; (x: { foo(x: RegExp): string; }): any; } +>x : { foo(x: RegExp): string; } +>b : { foo(x: RegExp): string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: RegExp) => string; }): any; (x: { foo: (x: RegExp) => string; }): any; } ->x : { foo: (x: RegExp) => string; } ->b : { foo: (x: RegExp) => string; } +>foo4 : { (x: { foo(x: RegExp): string; }): any; (x: { foo(x: RegExp): string; }): any; } +>x : { foo(x: RegExp): string; } +>b : { foo(x: RegExp): string; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: RegExp) => string; }): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo4 : { (x: { foo(x: RegExp): string; }): any; (x: { foo(x: RegExp): string; }): any; } >x : any function foo5(x: A); @@ -243,17 +243,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: RegExp): string; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: RegExp) => string; }): any; } ->x : { foo: (x: RegExp) => string; } ->b : { foo: (x: RegExp) => string; } +>foo11 : { (x: B): any; (x: { foo(x: RegExp): string; }): any; } +>x : { foo(x: RegExp): string; } +>b : { foo(x: RegExp): string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: RegExp): string; }): any; } >x : any function foo12(x: I); @@ -299,17 +299,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: RegExp): string; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: RegExp) => string; }): any; } ->x : { foo: (x: RegExp) => string; } ->b : { foo: (x: RegExp) => string; } +>foo14 : { (x: I): any; (x: { foo(x: RegExp): string; }): any; } +>x : { foo(x: RegExp): string; } +>b : { foo(x: RegExp): string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: RegExp): string; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types index 90ad61ad044..2f97c721637 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types @@ -57,8 +57,8 @@ var a: { foo(x: string, y: string): string } >y : string var b = { foo(x: string) { return ''; } }; ->b : { foo: (x: string) => string; } ->{ foo(x: string) { return ''; } } : { foo: (x: string) => string; } +>b : { foo(x: string): string; } +>{ foo(x: string) { return ''; } } : { foo(x: string): string; } >foo : (x: string) => string >x : string @@ -133,17 +133,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } ->x : { foo: (x: string) => string; } ->b : { foo: (x: string) => string; } +>foo4 : { (x: { foo(x: string): string; }): any; (x: { foo(x: string): string; }): any; } +>x : { foo(x: string): string; } +>b : { foo(x: string): string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } ->x : { foo: (x: string) => string; } ->b : { foo: (x: string) => string; } +>foo4 : { (x: { foo(x: string): string; }): any; (x: { foo(x: string): string; }): any; } +>x : { foo(x: string): string; } +>b : { foo(x: string): string; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } +>foo4 : { (x: { foo(x: string): string; }): any; (x: { foo(x: string): string; }): any; } >x : any function foo5(x: A); @@ -245,17 +245,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: string): string; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } ->x : { foo: (x: string) => string; } ->b : { foo: (x: string) => string; } +>foo11 : { (x: B): any; (x: { foo(x: string): string; }): any; } +>x : { foo(x: string): string; } +>b : { foo(x: string): string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: string): string; }): any; } >x : any function foo12(x: I); @@ -301,17 +301,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: string): string; }): any; } >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } ->x : { foo: (x: string) => string; } ->b : { foo: (x: string) => string; } +>foo14 : { (x: I): any; (x: { foo(x: string): string; }): any; } +>x : { foo(x: string): string; } +>b : { foo(x: string): string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: string): string; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types index ef31cf1fe4d..c3ab4ffb837 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types @@ -100,8 +100,8 @@ var a: { } var b = { ->b : { foo: (x: any) => any; } ->{ foo(x: any) { return ''; }} : { foo: (x: any) => any; } +>b : { foo(x: any): any; } +>{ foo(x: any) { return ''; }} : { foo(x: any): any; } foo(x: any) { return ''; } >foo : (x: any) => any @@ -181,17 +181,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: any) => any; }): any; (x: { foo: (x: any) => any; }): any; } ->x : { foo: (x: any) => any; } ->b : { foo: (x: any) => any; } +>foo4 : { (x: { foo(x: any): any; }): any; (x: { foo(x: any): any; }): any; } +>x : { foo(x: any): any; } +>b : { foo(x: any): any; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: any) => any; }): any; (x: { foo: (x: any) => any; }): any; } ->x : { foo: (x: any) => any; } ->b : { foo: (x: any) => any; } +>foo4 : { (x: { foo(x: any): any; }): any; (x: { foo(x: any): any; }): any; } +>x : { foo(x: any): any; } +>b : { foo(x: any): any; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: any) => any; }): any; (x: { foo: (x: any) => any; }): any; } +>foo4 : { (x: { foo(x: any): any; }): any; (x: { foo(x: any): any; }): any; } >x : any function foo5(x: A); @@ -293,17 +293,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: any) => any; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: any): any; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: any) => any; }): any; } ->x : { foo: (x: any) => any; } ->b : { foo: (x: any) => any; } +>foo11 : { (x: B): any; (x: { foo(x: any): any; }): any; } +>x : { foo(x: any): any; } +>b : { foo(x: any): any; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: any) => any; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: any): any; }): any; } >x : any function foo12(x: I); @@ -349,17 +349,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: any) => any; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: any): any; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: any) => any; }): any; } ->x : { foo: (x: any) => any; } ->b : { foo: (x: any) => any; } +>foo14 : { (x: I): any; (x: { foo(x: any): any; }): any; } +>x : { foo(x: any): any; } +>b : { foo(x: any): any; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: any) => any; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: any): any; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types index b44bc323a3d..769682c826a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types @@ -40,8 +40,8 @@ var a: { new(x: Date): string } >Date : Date var b = { new(x: RegExp) { return ''; } }; // not a construct signature, function called new ->b : { new: (x: RegExp) => string; } ->{ new(x: RegExp) { return ''; } } : { new: (x: RegExp) => string; } +>b : { new(x: RegExp): string; } +>{ new(x: RegExp) { return ''; } } : { new(x: RegExp): string; } >new : (x: RegExp) => string >x : RegExp >RegExp : RegExp @@ -103,17 +103,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: RegExp) => string; }): any; (x: { new: (x: RegExp) => string; }): any; } ->x : { new: (x: RegExp) => string; } ->b : { new: (x: RegExp) => string; } +>foo4 : { (x: { new(x: RegExp): string; }): any; (x: { new(x: RegExp): string; }): any; } +>x : { new(x: RegExp): string; } +>b : { new(x: RegExp): string; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: RegExp) => string; }): any; (x: { new: (x: RegExp) => string; }): any; } ->x : { new: (x: RegExp) => string; } ->b : { new: (x: RegExp) => string; } +>foo4 : { (x: { new(x: RegExp): string; }): any; (x: { new(x: RegExp): string; }): any; } +>x : { new(x: RegExp): string; } +>b : { new(x: RegExp): string; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: RegExp) => string; }): any; (x: { new: (x: RegExp) => string; }): any; } +>foo4 : { (x: { new(x: RegExp): string; }): any; (x: { new(x: RegExp): string; }): any; } >x : any function foo8(x: B); @@ -159,17 +159,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: RegExp) => string; }): any; } +>foo11 : { (x: B): any; (x: { new(x: RegExp): string; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: RegExp) => string; }): any; } ->x : { new: (x: RegExp) => string; } ->b : { new: (x: RegExp) => string; } +>foo11 : { (x: B): any; (x: { new(x: RegExp): string; }): any; } +>x : { new(x: RegExp): string; } +>b : { new(x: RegExp): string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: RegExp) => string; }): any; } +>foo11 : { (x: B): any; (x: { new(x: RegExp): string; }): any; } >x : any function foo12(x: I); @@ -215,17 +215,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: RegExp) => string; }): any; } +>foo14 : { (x: I): any; (x: { new(x: RegExp): string; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: RegExp) => string; }): any; } ->x : { new: (x: RegExp) => string; } ->b : { new: (x: RegExp) => string; } +>foo14 : { (x: I): any; (x: { new(x: RegExp): string; }): any; } +>x : { new(x: RegExp): string; } +>b : { new(x: RegExp): string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: RegExp) => string; }): any; } +>foo14 : { (x: I): any; (x: { new(x: RegExp): string; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types index 8d26b98c361..a2779e3bd35 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types @@ -43,8 +43,8 @@ var a: { new(x: string, y: string): string } >y : string var b = { new(x: string) { return ''; } }; // not a construct signature, function called new ->b : { new: (x: string) => string; } ->{ new(x: string) { return ''; } } : { new: (x: string) => string; } +>b : { new(x: string): string; } +>{ new(x: string) { return ''; } } : { new(x: string): string; } >new : (x: string) => string >x : string @@ -105,17 +105,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: string) => string; }): any; (x: { new: (x: string) => string; }): any; } ->x : { new: (x: string) => string; } ->b : { new: (x: string) => string; } +>foo4 : { (x: { new(x: string): string; }): any; (x: { new(x: string): string; }): any; } +>x : { new(x: string): string; } +>b : { new(x: string): string; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: string) => string; }): any; (x: { new: (x: string) => string; }): any; } ->x : { new: (x: string) => string; } ->b : { new: (x: string) => string; } +>foo4 : { (x: { new(x: string): string; }): any; (x: { new(x: string): string; }): any; } +>x : { new(x: string): string; } +>b : { new(x: string): string; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: string) => string; }): any; (x: { new: (x: string) => string; }): any; } +>foo4 : { (x: { new(x: string): string; }): any; (x: { new(x: string): string; }): any; } >x : any function foo8(x: B); @@ -161,17 +161,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: string) => string; }): any; } +>foo11 : { (x: B): any; (x: { new(x: string): string; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: string) => string; }): any; } ->x : { new: (x: string) => string; } ->b : { new: (x: string) => string; } +>foo11 : { (x: B): any; (x: { new(x: string): string; }): any; } +>x : { new(x: string): string; } +>b : { new(x: string): string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: string) => string; }): any; } +>foo11 : { (x: B): any; (x: { new(x: string): string; }): any; } >x : any function foo12(x: I); @@ -217,17 +217,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: string) => string; }): any; } +>foo14 : { (x: I): any; (x: { new(x: string): string; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: string) => string; }): any; } ->x : { new: (x: string) => string; } ->b : { new: (x: string) => string; } +>foo14 : { (x: I): any; (x: { new(x: string): string; }): any; } +>x : { new(x: string): string; } +>b : { new(x: string): string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: string) => string; }): any; } +>foo14 : { (x: I): any; (x: { new(x: string): string; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types index 3416662ffde..d3cf9bc0063 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types @@ -65,8 +65,8 @@ var a: { foo(x: T): T } >T : T var b = { foo(x: T) { return x; } }; ->b : { foo: (x: T) => T; } ->{ foo(x: T) { return x; } } : { foo: (x: T) => T; } +>b : { foo(x: T): T; } +>{ foo(x: T) { return x; } } : { foo(x: T): T; } >foo : (x: T) => T >T : T >x : T @@ -144,17 +144,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T) => T; }): any; (x: { foo: (x: T) => T; }): any; } ->x : { foo: (x: T) => T; } ->b : { foo: (x: T) => T; } +>foo4 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>x : { foo(x: T): T; } +>b : { foo(x: T): T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T) => T; }): any; (x: { foo: (x: T) => T; }): any; } ->x : { foo: (x: T) => T; } ->b : { foo: (x: T) => T; } +>foo4 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>x : { foo(x: T): T; } +>b : { foo(x: T): T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T) => T; }): any; (x: { foo: (x: T) => T; }): any; } +>foo4 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } >x : any function foo5(x: A); @@ -256,17 +256,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T): T; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T) => T; }): any; } ->x : { foo: (x: T) => T; } ->b : { foo: (x: T) => T; } +>foo11 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>x : { foo(x: T): T; } +>b : { foo(x: T): T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T): T; }): any; } >x : any function foo12(x: I); @@ -312,17 +312,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T): T; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T) => T; }): any; } ->x : { foo: (x: T) => T; } ->b : { foo: (x: T) => T; } +>foo14 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>x : { foo(x: T): T; } +>b : { foo(x: T): T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T): T; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types index a7a70a5321d..0c00e587b78 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types @@ -83,8 +83,8 @@ var a: { foo(x: T, y: U): T } >T : T var b = { foo(x: T, y: U) { return x; } }; ->b : { foo: (x: T, y: U) => T; } ->{ foo(x: T, y: U) { return x; } } : { foo: (x: T, y: U) => T; } +>b : { foo(x: T, y: U): T; } +>{ foo(x: T, y: U) { return x; } } : { foo(x: T, y: U): T; } >foo : (x: T, y: U) => T >T : T >U : U @@ -165,17 +165,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } ->x : { foo: (x: T, y: U) => T; } ->b : { foo: (x: T, y: U) => T; } +>foo4 : { (x: { foo(x: T, y: U): T; }): any; (x: { foo(x: T, y: U): T; }): any; } +>x : { foo(x: T, y: U): T; } +>b : { foo(x: T, y: U): T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } ->x : { foo: (x: T, y: U) => T; } ->b : { foo: (x: T, y: U) => T; } +>foo4 : { (x: { foo(x: T, y: U): T; }): any; (x: { foo(x: T, y: U): T; }): any; } +>x : { foo(x: T, y: U): T; } +>b : { foo(x: T, y: U): T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo4 : { (x: { foo(x: T, y: U): T; }): any; (x: { foo(x: T, y: U): T; }): any; } >x : any function foo5(x: A); @@ -277,17 +277,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): T; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } ->x : { foo: (x: T, y: U) => T; } ->b : { foo: (x: T, y: U) => T; } +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): T; }): any; } +>x : { foo(x: T, y: U): T; } +>b : { foo(x: T, y: U): T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): T; }): any; } >x : any function foo12(x: I); @@ -333,17 +333,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T, y: U): T; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } ->x : { foo: (x: T, y: U) => T; } ->b : { foo: (x: T, y: U) => T; } +>foo14 : { (x: I): any; (x: { foo(x: T, y: U): T; }): any; } +>x : { foo(x: T, y: U): T; } +>b : { foo(x: T, y: U): T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T, y: U): T; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types index 04186162b85..432a618c4e2 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types @@ -67,8 +67,8 @@ var a: { foo>(x: T): string } >T : T var b = { foo(x: T) { return ''; } }; ->b : { foo: (x: T) => string; } ->{ foo(x: T) { return ''; } } : { foo: (x: T) => string; } +>b : { foo(x: T): string; } +>{ foo(x: T) { return ''; } } : { foo(x: T): string; } >foo : (x: T) => string >T : T >RegExp : RegExp @@ -152,17 +152,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T) => string; }): any; (x: { foo: (x: T) => string; }): any; } ->x : { foo: (x: T) => string; } ->b : { foo: (x: T) => string; } +>foo4 : { (x: { foo(x: T): string; }): any; (x: { foo(x: T): string; }): any; } +>x : { foo(x: T): string; } +>b : { foo(x: T): string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T) => string; }): any; (x: { foo: (x: T) => string; }): any; } ->x : { foo: (x: T) => string; } ->b : { foo: (x: T) => string; } +>foo4 : { (x: { foo(x: T): string; }): any; (x: { foo(x: T): string; }): any; } +>x : { foo(x: T): string; } +>b : { foo(x: T): string; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T) => string; }): any; (x: { foo: (x: T) => string; }): any; } +>foo4 : { (x: { foo(x: T): string; }): any; (x: { foo(x: T): string; }): any; } >x : any function foo5(x: A); @@ -272,18 +272,18 @@ function foo10(x: any) { } >x : any function foo11(x: B>); ->foo11 : { (x: B): any; (x: { foo: (x: T) => string; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T): string; }): any; } >x : B >B : B >Array : T[] function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T) => string; }): any; } ->x : { foo: (x: T) => string; } ->b : { foo: (x: T) => string; } +>foo11 : { (x: B): any; (x: { foo(x: T): string; }): any; } +>x : { foo(x: T): string; } +>b : { foo(x: T): string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T) => string; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T): string; }): any; } >x : any function foo12(x: I); @@ -333,18 +333,18 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T) => string; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T): string; }): any; } >x : I >I : I >Number : Number function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T) => string; }): any; } ->x : { foo: (x: T) => string; } ->b : { foo: (x: T) => string; } +>foo14 : { (x: I): any; (x: { foo(x: T): string; }): any; } +>x : { foo(x: T): string; } +>b : { foo(x: T): string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T) => string; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T): string; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types index ca7860a68d4..8b5a042c1e2 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types @@ -64,8 +64,8 @@ var a: { foo(x: T): T } >T : T var b = { foo(x: T) { return null; } }; ->b : { foo: (x: T) => any; } ->{ foo(x: T) { return null; } } : { foo: (x: T) => any; } +>b : { foo(x: T): any; } +>{ foo(x: T) { return null; } } : { foo(x: T): any; } >foo : (x: T) => any >T : T >x : T @@ -142,17 +142,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } ->x : { foo: (x: T) => any; } ->b : { foo: (x: T) => any; } +>foo4 : { (x: { foo(x: T): any; }): any; (x: { foo(x: T): any; }): any; } +>x : { foo(x: T): any; } +>b : { foo(x: T): any; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } ->x : { foo: (x: T) => any; } ->b : { foo: (x: T) => any; } +>foo4 : { (x: { foo(x: T): any; }): any; (x: { foo(x: T): any; }): any; } +>x : { foo(x: T): any; } +>b : { foo(x: T): any; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } +>foo4 : { (x: { foo(x: T): any; }): any; (x: { foo(x: T): any; }): any; } >x : any function foo5(x: A); @@ -254,17 +254,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T): any; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } ->x : { foo: (x: T) => any; } ->b : { foo: (x: T) => any; } +>foo11 : { (x: B): any; (x: { foo(x: T): any; }): any; } +>x : { foo(x: T): any; } +>b : { foo(x: T): any; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T): any; }): any; } >x : any function foo12(x: I); @@ -310,17 +310,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T): any; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } ->x : { foo: (x: T) => any; } ->b : { foo: (x: T) => any; } +>foo14 : { (x: I): any; (x: { foo(x: T): any; }): any; } +>x : { foo(x: T): any; } +>b : { foo(x: T): any; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T): any; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types index 6678a6df110..2863cafa885 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types @@ -70,8 +70,8 @@ var a: { foo(x: T): T } >T : T var b = { foo(x: T) { return null; } }; ->b : { foo: (x: T) => any; } ->{ foo(x: T) { return null; } } : { foo: (x: T) => any; } +>b : { foo(x: T): any; } +>{ foo(x: T) { return null; } } : { foo(x: T): any; } >foo : (x: T) => any >T : T >Date : Date @@ -155,17 +155,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } ->x : { foo: (x: T) => any; } ->b : { foo: (x: T) => any; } +>foo4 : { (x: { foo(x: T): any; }): any; (x: { foo(x: T): any; }): any; } +>x : { foo(x: T): any; } +>b : { foo(x: T): any; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } ->x : { foo: (x: T) => any; } ->b : { foo: (x: T) => any; } +>foo4 : { (x: { foo(x: T): any; }): any; (x: { foo(x: T): any; }): any; } +>x : { foo(x: T): any; } +>b : { foo(x: T): any; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } +>foo4 : { (x: { foo(x: T): any; }): any; (x: { foo(x: T): any; }): any; } >x : any function foo5(x: A); @@ -275,18 +275,18 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T): any; }): any; } >x : B >B : B >Date : Date function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } ->x : { foo: (x: T) => any; } ->b : { foo: (x: T) => any; } +>foo11 : { (x: B): any; (x: { foo(x: T): any; }): any; } +>x : { foo(x: T): any; } +>b : { foo(x: T): any; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T): any; }): any; } >x : any function foo12(x: I); @@ -336,18 +336,18 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T): any; }): any; } >x : I >I : I >Date : Date function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } ->x : { foo: (x: T) => any; } ->b : { foo: (x: T) => any; } +>foo14 : { (x: I): any; (x: { foo(x: T): any; }): any; } +>x : { foo(x: T): any; } +>b : { foo(x: T): any; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T): any; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types index d2644f41204..125b82c9915 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types @@ -78,8 +78,8 @@ var a: { foo(x: Z): Z } >Z : Z var b = { foo(x: A) { return x; } }; ->b : { foo: (x: A) => A; } ->{ foo(x: A) { return x; } } : { foo: (x: A) => A; } +>b : { foo(x: A): A; } +>{ foo(x: A) { return x; } } : { foo(x: A): A; } >foo : (x: A) => A >A : A >B : B @@ -162,17 +162,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } ->x : { foo: (x: A) => A; } ->b : { foo: (x: A) => A; } +>foo4 : { (x: { foo(x: A): A; }): any; (x: { foo(x: A): A; }): any; } +>x : { foo(x: A): A; } +>b : { foo(x: A): A; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } ->x : { foo: (x: A) => A; } ->b : { foo: (x: A) => A; } +>foo4 : { (x: { foo(x: A): A; }): any; (x: { foo(x: A): A; }): any; } +>x : { foo(x: A): A; } +>b : { foo(x: A): A; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } +>foo4 : { (x: { foo(x: A): A; }): any; (x: { foo(x: A): A; }): any; } >x : any function foo5(x: A); @@ -277,17 +277,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: A): A; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } ->x : { foo: (x: A) => A; } ->b : { foo: (x: A) => A; } +>foo11 : { (x: B): any; (x: { foo(x: A): A; }): any; } +>x : { foo(x: A): A; } +>b : { foo(x: A): A; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: A): A; }): any; } >x : any function foo12(x: I, number, Date, string>); @@ -340,19 +340,19 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: A): A; }): any; } >x : I >I : I >Date : Date >RegExp : RegExp function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } ->x : { foo: (x: A) => A; } ->b : { foo: (x: A) => A; } +>foo14 : { (x: I): any; (x: { foo(x: A): A; }): any; } +>x : { foo(x: A): A; } +>b : { foo(x: A): A; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: A): A; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types index e5afc672fe1..fd0b14a4f79 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types @@ -65,8 +65,8 @@ var a: { foo(x: Z): Z } >Z : Z var b = { foo(x: A) { return x; } }; ->b : { foo: (x: A) => A; } ->{ foo(x: A) { return x; } } : { foo: (x: A) => A; } +>b : { foo(x: A): A; } +>{ foo(x: A) { return x; } } : { foo(x: A): A; } >foo : (x: A) => A >A : A >x : A @@ -144,17 +144,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } ->x : { foo: (x: A) => A; } ->b : { foo: (x: A) => A; } +>foo4 : { (x: { foo(x: A): A; }): any; (x: { foo(x: A): A; }): any; } +>x : { foo(x: A): A; } +>b : { foo(x: A): A; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } ->x : { foo: (x: A) => A; } ->b : { foo: (x: A) => A; } +>foo4 : { (x: { foo(x: A): A; }): any; (x: { foo(x: A): A; }): any; } +>x : { foo(x: A): A; } +>b : { foo(x: A): A; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } +>foo4 : { (x: { foo(x: A): A; }): any; (x: { foo(x: A): A; }): any; } >x : any function foo5(x: A); @@ -256,17 +256,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: A): A; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } ->x : { foo: (x: A) => A; } ->b : { foo: (x: A) => A; } +>foo11 : { (x: B): any; (x: { foo(x: A): A; }): any; } +>x : { foo(x: A): A; } +>b : { foo(x: A): A; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: A): A; }): any; } >x : any function foo12(x: I); @@ -312,17 +312,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: A): A; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } ->x : { foo: (x: A) => A; } ->b : { foo: (x: A) => A; } +>foo14 : { (x: I): any; (x: { foo(x: A): A; }): any; } +>x : { foo(x: A): A; } +>b : { foo(x: A): A; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: A): A; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types index e4b8417008a..33fce5295a7 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types @@ -79,8 +79,8 @@ var a: { foo(x: T, y?: T): T } >T : T var b = { foo(x: T, y?: T) { return x; } }; ->b : { foo: (x: T, y?: T) => T; } ->{ foo(x: T, y?: T) { return x; } } : { foo: (x: T, y?: T) => T; } +>b : { foo(x: T, y?: T): T; } +>{ foo(x: T, y?: T) { return x; } } : { foo(x: T, y?: T): T; } >foo : (x: T, y?: T) => T >T : T >x : T @@ -160,17 +160,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T, y?: T) => T; }): any; (x: { foo: (x: T, y?: T) => T; }): any; } ->x : { foo: (x: T, y?: T) => T; } ->b : { foo: (x: T, y?: T) => T; } +>foo4 : { (x: { foo(x: T, y?: T): T; }): any; (x: { foo(x: T, y?: T): T; }): any; } +>x : { foo(x: T, y?: T): T; } +>b : { foo(x: T, y?: T): T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T, y?: T) => T; }): any; (x: { foo: (x: T, y?: T) => T; }): any; } ->x : { foo: (x: T, y?: T) => T; } ->b : { foo: (x: T, y?: T) => T; } +>foo4 : { (x: { foo(x: T, y?: T): T; }): any; (x: { foo(x: T, y?: T): T; }): any; } +>x : { foo(x: T, y?: T): T; } +>b : { foo(x: T, y?: T): T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T, y?: T) => T; }): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo4 : { (x: { foo(x: T, y?: T): T; }): any; (x: { foo(x: T, y?: T): T; }): any; } >x : any function foo5(x: A); @@ -272,17 +272,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T, y?: T): T; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: T) => T; }): any; } ->x : { foo: (x: T, y?: T) => T; } ->b : { foo: (x: T, y?: T) => T; } +>foo11 : { (x: B): any; (x: { foo(x: T, y?: T): T; }): any; } +>x : { foo(x: T, y?: T): T; } +>b : { foo(x: T, y?: T): T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T, y?: T): T; }): any; } >x : any function foo12(x: I); @@ -328,17 +328,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T, y?: T): T; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: T) => T; }): any; } ->x : { foo: (x: T, y?: T) => T; } ->b : { foo: (x: T, y?: T) => T; } +>foo14 : { (x: I): any; (x: { foo(x: T, y?: T): T; }): any; } +>x : { foo(x: T, y?: T): T; } +>b : { foo(x: T, y?: T): T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T, y?: T): T; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types index 9951084c84e..2d9eab7c540 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types @@ -85,8 +85,8 @@ var a: { foo(x: T, y?: U): T } >T : T var b = { foo(x: T, y?: U) { return x; } }; ->b : { foo: (x: T, y?: U) => T; } ->{ foo(x: T, y?: U) { return x; } } : { foo: (x: T, y?: U) => T; } +>b : { foo(x: T, y?: U): T; } +>{ foo(x: T, y?: U) { return x; } } : { foo(x: T, y?: U): T; } >foo : (x: T, y?: U) => T >T : T >U : U @@ -167,17 +167,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T, y?: U) => T; }): any; (x: { foo: (x: T, y?: U) => T; }): any; } ->x : { foo: (x: T, y?: U) => T; } ->b : { foo: (x: T, y?: U) => T; } +>foo4 : { (x: { foo(x: T, y?: U): T; }): any; (x: { foo(x: T, y?: U): T; }): any; } +>x : { foo(x: T, y?: U): T; } +>b : { foo(x: T, y?: U): T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T, y?: U) => T; }): any; (x: { foo: (x: T, y?: U) => T; }): any; } ->x : { foo: (x: T, y?: U) => T; } ->b : { foo: (x: T, y?: U) => T; } +>foo4 : { (x: { foo(x: T, y?: U): T; }): any; (x: { foo(x: T, y?: U): T; }): any; } +>x : { foo(x: T, y?: U): T; } +>b : { foo(x: T, y?: U): T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T, y?: U) => T; }): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo4 : { (x: { foo(x: T, y?: U): T; }): any; (x: { foo(x: T, y?: U): T; }): any; } >x : any function foo5(x: A); @@ -279,17 +279,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T, y?: U): T; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: U) => T; }): any; } ->x : { foo: (x: T, y?: U) => T; } ->b : { foo: (x: T, y?: U) => T; } +>foo11 : { (x: B): any; (x: { foo(x: T, y?: U): T; }): any; } +>x : { foo(x: T, y?: U): T; } +>b : { foo(x: T, y?: U): T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T, y?: U): T; }): any; } >x : any function foo12(x: I); @@ -335,17 +335,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T, y?: U): T; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: U) => T; }): any; } ->x : { foo: (x: T, y?: U) => T; } ->b : { foo: (x: T, y?: U) => T; } +>foo14 : { (x: I): any; (x: { foo(x: T, y?: U): T; }): any; } +>x : { foo(x: T, y?: U): T; } +>b : { foo(x: T, y?: U): T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T, y?: U): T; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types index bc5c91f94fa..54ec438104e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types @@ -85,8 +85,8 @@ var a: { foo(x: T, y?: U): T } >T : T var b = { foo(x: T, y: U) { return x; } }; ->b : { foo: (x: T, y: U) => T; } ->{ foo(x: T, y: U) { return x; } } : { foo: (x: T, y: U) => T; } +>b : { foo(x: T, y: U): T; } +>{ foo(x: T, y: U) { return x; } } : { foo(x: T, y: U): T; } >foo : (x: T, y: U) => T >T : T >U : U @@ -167,17 +167,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } ->x : { foo: (x: T, y: U) => T; } ->b : { foo: (x: T, y: U) => T; } +>foo4 : { (x: { foo(x: T, y: U): T; }): any; (x: { foo(x: T, y: U): T; }): any; } +>x : { foo(x: T, y: U): T; } +>b : { foo(x: T, y: U): T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } ->x : { foo: (x: T, y: U) => T; } ->b : { foo: (x: T, y: U) => T; } +>foo4 : { (x: { foo(x: T, y: U): T; }): any; (x: { foo(x: T, y: U): T; }): any; } +>x : { foo(x: T, y: U): T; } +>b : { foo(x: T, y: U): T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo4 : { (x: { foo(x: T, y: U): T; }): any; (x: { foo(x: T, y: U): T; }): any; } >x : any function foo5(x: A); @@ -279,17 +279,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): T; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } ->x : { foo: (x: T, y: U) => T; } ->b : { foo: (x: T, y: U) => T; } +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): T; }): any; } +>x : { foo(x: T, y: U): T; } +>b : { foo(x: T, y: U): T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : { (x: B): any; (x: { foo(x: T, y: U): T; }): any; } >x : any function foo12(x: I); @@ -335,17 +335,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T, y: U): T; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } ->x : { foo: (x: T, y: U) => T; } ->b : { foo: (x: T, y: U) => T; } +>foo14 : { (x: I): any; (x: { foo(x: T, y: U): T; }): any; } +>x : { foo(x: T, y: U): T; } +>b : { foo(x: T, y: U): T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : { (x: I): any; (x: { foo(x: T, y: U): T; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types index cd327865d12..7acc93db124 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types @@ -51,8 +51,8 @@ var a: { new>(x: T): string } >T : T var b = { new(x: T) { return ''; } }; // not a construct signature, function called new ->b : { new: (x: T) => string; } ->{ new(x: T) { return ''; } } : { new: (x: T) => string; } +>b : { new(x: T): string; } +>{ new(x: T) { return ''; } } : { new(x: T): string; } >new : (x: T) => string >T : T >RegExp : RegExp @@ -122,17 +122,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T) => string; }): any; (x: { new: (x: T) => string; }): any; } ->x : { new: (x: T) => string; } ->b : { new: (x: T) => string; } +>foo4 : { (x: { new(x: T): string; }): any; (x: { new(x: T): string; }): any; } +>x : { new(x: T): string; } +>b : { new(x: T): string; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T) => string; }): any; (x: { new: (x: T) => string; }): any; } ->x : { new: (x: T) => string; } ->b : { new: (x: T) => string; } +>foo4 : { (x: { new(x: T): string; }): any; (x: { new(x: T): string; }): any; } +>x : { new(x: T): string; } +>b : { new(x: T): string; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T) => string; }): any; (x: { new: (x: T) => string; }): any; } +>foo4 : { (x: { new(x: T): string; }): any; (x: { new(x: T): string; }): any; } >x : any function foo8(x: B>); @@ -183,18 +183,18 @@ function foo10(x: any) { } >x : any function foo11(x: B>); ->foo11 : { (x: B): any; (x: { new: (x: T) => string; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T): string; }): any; } >x : B >B : B >Array : T[] function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T) => string; }): any; } ->x : { new: (x: T) => string; } ->b : { new: (x: T) => string; } +>foo11 : { (x: B): any; (x: { new(x: T): string; }): any; } +>x : { new(x: T): string; } +>b : { new(x: T): string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T) => string; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T): string; }): any; } >x : any function foo12(x: I); @@ -244,17 +244,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T) => string; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T): string; }): any; } >x : I >I : I >Number : Number function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T) => string; }): any; } ->x : { new: (x: T) => string; } ->b : { new: (x: T) => string; } +>foo14 : { (x: I): any; (x: { new(x: T): string; }): any; } +>x : { new(x: T): string; } +>b : { new(x: T): string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T) => string; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T): string; }): any; } >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types index 712958ca55b..4b2e628ad5d 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types @@ -49,8 +49,8 @@ var a: { new(x: T): T } >T : T var b = { new(x: T): T { return null; } }; // not a construct signature, function called new ->b : { new: (x: T) => T; } ->{ new(x: T): T { return null; } } : { new: (x: T) => T; } +>b : { new(x: T): T; } +>{ new(x: T): T { return null; } } : { new(x: T): T; } >new : (x: T) => T >T : T >x : T @@ -114,31 +114,31 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T) => T; }): any; (x: { new: (x: T) => T; }): any; } ->x : { new: (x: T) => T; } ->b : { new: (x: T) => T; } +>foo4 : { (x: { new(x: T): T; }): any; (x: { new(x: T): T; }): any; } +>x : { new(x: T): T; } +>b : { new(x: T): T; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T) => T; }): any; (x: { new: (x: T) => T; }): any; } ->x : { new: (x: T) => T; } ->b : { new: (x: T) => T; } +>foo4 : { (x: { new(x: T): T; }): any; (x: { new(x: T): T; }): any; } +>x : { new(x: T): T; } +>b : { new(x: T): T; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T) => T; }): any; (x: { new: (x: T) => T; }): any; } +>foo4 : { (x: { new(x: T): T; }): any; (x: { new(x: T): T; }): any; } >x : any function foo5(x: typeof a): number; ->foo5 : { (x: new (x: T) => T): number; (x: { new: (x: T) => T; }): string; } +>foo5 : { (x: new (x: T) => T): number; (x: { new(x: T): T; }): string; } >x : new (x: T) => T >a : new (x: T) => T function foo5(x: typeof b): string; // ok ->foo5 : { (x: new (x: T) => T): number; (x: { new: (x: T) => T; }): string; } ->x : { new: (x: T) => T; } ->b : { new: (x: T) => T; } +>foo5 : { (x: new (x: T) => T): number; (x: { new(x: T): T; }): string; } +>x : { new(x: T): T; } +>b : { new(x: T): T; } function foo5(x: any): any { } ->foo5 : { (x: new (x: T) => T): number; (x: { new: (x: T) => T; }): string; } +>foo5 : { (x: new (x: T) => T): number; (x: { new(x: T): T; }): string; } >x : any function foo8(x: B); @@ -184,17 +184,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T) => T; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T): T; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T) => T; }): any; } ->x : { new: (x: T) => T; } ->b : { new: (x: T) => T; } +>foo11 : { (x: B): any; (x: { new(x: T): T; }): any; } +>x : { new(x: T): T; } +>b : { new(x: T): T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T) => T; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T): T; }): any; } >x : any function foo12(x: I); @@ -240,17 +240,17 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T) => T; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T): T; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T) => T; }): any; } ->x : { new: (x: T) => T; } ->b : { new: (x: T) => T; } +>foo14 : { (x: I): any; (x: { new(x: T): T; }): any; } +>x : { new(x: T): T; } +>b : { new(x: T): T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T) => T; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T): T; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types index 80b25828d50..a25fb5b876a 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types @@ -54,8 +54,8 @@ var a: { new(x: T): T } >T : T var b = { new(x: T) { return null; } }; // not a construct signature, function called new ->b : { new: (x: T) => any; } ->{ new(x: T) { return null; } } : { new: (x: T) => any; } +>b : { new(x: T): any; } +>{ new(x: T) { return null; } } : { new(x: T): any; } >new : (x: T) => any >T : T >Date : Date @@ -125,17 +125,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T) => any; }): any; (x: { new: (x: T) => any; }): any; } ->x : { new: (x: T) => any; } ->b : { new: (x: T) => any; } +>foo4 : { (x: { new(x: T): any; }): any; (x: { new(x: T): any; }): any; } +>x : { new(x: T): any; } +>b : { new(x: T): any; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T) => any; }): any; (x: { new: (x: T) => any; }): any; } ->x : { new: (x: T) => any; } ->b : { new: (x: T) => any; } +>foo4 : { (x: { new(x: T): any; }): any; (x: { new(x: T): any; }): any; } +>x : { new(x: T): any; } +>b : { new(x: T): any; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T) => any; }): any; (x: { new: (x: T) => any; }): any; } +>foo4 : { (x: { new(x: T): any; }): any; (x: { new(x: T): any; }): any; } >x : any function foo8(x: B); @@ -186,18 +186,18 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T) => any; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T): any; }): any; } >x : B >B : B >Date : Date function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T) => any; }): any; } ->x : { new: (x: T) => any; } ->b : { new: (x: T) => any; } +>foo11 : { (x: B): any; (x: { new(x: T): any; }): any; } +>x : { new(x: T): any; } +>b : { new(x: T): any; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T) => any; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T): any; }): any; } >x : any function foo12(x: I); @@ -247,18 +247,18 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T) => any; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T): any; }): any; } >x : I >I : I >Date : Date function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T) => any; }): any; } ->x : { new: (x: T) => any; } ->b : { new: (x: T) => any; } +>foo14 : { (x: I): any; (x: { new(x: T): any; }): any; } +>x : { new(x: T): any; } +>b : { new(x: T): any; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T) => any; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T): any; }): any; } >x : any function foo15(x: I2); diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types index 15239aacf56..683c3ace9f9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types @@ -68,8 +68,8 @@ var a: { new (x: Z): C; } >B : B var b = { new(x: A) { return x; } }; ->b : { new: (x: A) => A; } ->{ new(x: A) { return x; } } : { new: (x: A) => A; } +>b : { new(x: A): A; } +>{ new(x: A) { return x; } } : { new(x: A): A; } >new : (x: A) => A >A : A >B : B @@ -138,17 +138,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: A) => A; }): any; (x: { new: (x: A) => A; }): any; } ->x : { new: (x: A) => A; } ->b : { new: (x: A) => A; } +>foo4 : { (x: { new(x: A): A; }): any; (x: { new(x: A): A; }): any; } +>x : { new(x: A): A; } +>b : { new(x: A): A; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: A) => A; }): any; (x: { new: (x: A) => A; }): any; } ->x : { new: (x: A) => A; } ->b : { new: (x: A) => A; } +>foo4 : { (x: { new(x: A): A; }): any; (x: { new(x: A): A; }): any; } +>x : { new(x: A): A; } +>b : { new(x: A): A; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: A) => A; }): any; (x: { new: (x: A) => A; }): any; } +>foo4 : { (x: { new(x: A): A; }): any; (x: { new(x: A): A; }): any; } >x : any function foo8(x: B); @@ -196,17 +196,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: A) => A; }): any; } +>foo11 : { (x: B): any; (x: { new(x: A): A; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: A) => A; }): any; } ->x : { new: (x: A) => A; } ->b : { new: (x: A) => A; } +>foo11 : { (x: B): any; (x: { new(x: A): A; }): any; } +>x : { new(x: A): A; } +>b : { new(x: A): A; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: A) => A; }): any; } +>foo11 : { (x: B): any; (x: { new(x: A): A; }): any; } >x : any function foo12(x: I, number, Date, string>); @@ -259,18 +259,18 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: A) => A; }): any; } +>foo14 : { (x: I): any; (x: { new(x: A): A; }): any; } >x : I >I : I >Date : Date >RegExp : RegExp function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: A) => A; }): any; } ->x : { new: (x: A) => A; } ->b : { new: (x: A) => A; } +>foo14 : { (x: I): any; (x: { new(x: A): A; }): any; } +>x : { new(x: A): A; } +>b : { new(x: A): A; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: A) => A; }): any; } +>foo14 : { (x: I): any; (x: { new(x: A): A; }): any; } >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types index 0ef822a5328..af65ca5b911 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types @@ -50,8 +50,8 @@ var a: { new(x: Z): B } >Z : Z var b = { new(x: A) { return new C(x); } }; ->b : { new: (x: A) => C; } ->{ new(x: A) { return new C(x); } } : { new: (x: A) => C; } +>b : { new(x: A): C; } +>{ new(x: A) { return new C(x); } } : { new(x: A): C; } >new : (x: A) => C >A : A >x : A @@ -118,17 +118,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: A) => C; }): any; (x: { new: (x: A) => C; }): any; } ->x : { new: (x: A) => C; } ->b : { new: (x: A) => C; } +>foo4 : { (x: { new(x: A): C; }): any; (x: { new(x: A): C; }): any; } +>x : { new(x: A): C; } +>b : { new(x: A): C; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: A) => C; }): any; (x: { new: (x: A) => C; }): any; } ->x : { new: (x: A) => C; } ->b : { new: (x: A) => C; } +>foo4 : { (x: { new(x: A): C; }): any; (x: { new(x: A): C; }): any; } +>x : { new(x: A): C; } +>b : { new(x: A): C; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: A) => C; }): any; (x: { new: (x: A) => C; }): any; } +>foo4 : { (x: { new(x: A): C; }): any; (x: { new(x: A): C; }): any; } >x : any function foo8(x: B); @@ -174,17 +174,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: A) => C; }): any; } +>foo11 : { (x: B): any; (x: { new(x: A): C; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: A) => C; }): any; } ->x : { new: (x: A) => C; } ->b : { new: (x: A) => C; } +>foo11 : { (x: B): any; (x: { new(x: A): C; }): any; } +>x : { new(x: A): C; } +>b : { new(x: A): C; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: A) => C; }): any; } +>foo11 : { (x: B): any; (x: { new(x: A): C; }): any; } >x : any function foo12(x: I); @@ -230,16 +230,16 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: A) => C; }): any; } +>foo14 : { (x: I): any; (x: { new(x: A): C; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: A) => C; }): any; } ->x : { new: (x: A) => C; } ->b : { new: (x: A) => C; } +>foo14 : { (x: I): any; (x: { new(x: A): C; }): any; } +>x : { new(x: A): C; } +>b : { new(x: A): C; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: A) => C; }): any; } +>foo14 : { (x: I): any; (x: { new(x: A): C; }): any; } >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types index a13dbe1bcf4..a6dea7c2518 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types @@ -62,8 +62,8 @@ var a: { new(x: T, y?: T): B } >T : T var b = { new(x: T, y?: T) { return new C(x, y); } }; // not a construct signature, function called new ->b : { new: (x: T, y?: T) => C; } ->{ new(x: T, y?: T) { return new C(x, y); } } : { new: (x: T, y?: T) => C; } +>b : { new(x: T, y?: T): C; } +>{ new(x: T, y?: T) { return new C(x, y); } } : { new(x: T, y?: T): C; } >new : (x: T, y?: T) => C >T : T >x : T @@ -133,17 +133,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T, y?: T) => C; }): any; (x: { new: (x: T, y?: T) => C; }): any; } ->x : { new: (x: T, y?: T) => C; } ->b : { new: (x: T, y?: T) => C; } +>foo4 : { (x: { new(x: T, y?: T): C; }): any; (x: { new(x: T, y?: T): C; }): any; } +>x : { new(x: T, y?: T): C; } +>b : { new(x: T, y?: T): C; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T, y?: T) => C; }): any; (x: { new: (x: T, y?: T) => C; }): any; } ->x : { new: (x: T, y?: T) => C; } ->b : { new: (x: T, y?: T) => C; } +>foo4 : { (x: { new(x: T, y?: T): C; }): any; (x: { new(x: T, y?: T): C; }): any; } +>x : { new(x: T, y?: T): C; } +>b : { new(x: T, y?: T): C; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T, y?: T) => C; }): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo4 : { (x: { new(x: T, y?: T): C; }): any; (x: { new(x: T, y?: T): C; }): any; } >x : any function foo8(x: B): string; @@ -189,17 +189,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T, y?: T): C; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T, y?: T) => C; }): any; } ->x : { new: (x: T, y?: T) => C; } ->b : { new: (x: T, y?: T) => C; } +>foo11 : { (x: B): any; (x: { new(x: T, y?: T): C; }): any; } +>x : { new(x: T, y?: T): C; } +>b : { new(x: T, y?: T): C; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T, y?: T): C; }): any; } >x : any function foo12(x: I); @@ -245,16 +245,16 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T, y?: T): C; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T, y?: T) => C; }): any; } ->x : { new: (x: T, y?: T) => C; } ->b : { new: (x: T, y?: T) => C; } +>foo14 : { (x: I): any; (x: { new(x: T, y?: T): C; }): any; } +>x : { new(x: T, y?: T): C; } +>b : { new(x: T, y?: T): C; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T, y?: T): C; }): any; } >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types index dc1429cc9ca..3c0f09e61da 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types @@ -70,8 +70,8 @@ var a: { new(x: T, y?: U): B } >U : U var b = { new(x: T, y?: U) { return new C(x, y); } }; // not a construct signature, function called new ->b : { new: (x: T, y?: U) => C; } ->{ new(x: T, y?: U) { return new C(x, y); } } : { new: (x: T, y?: U) => C; } +>b : { new(x: T, y?: U): C; } +>{ new(x: T, y?: U) { return new C(x, y); } } : { new(x: T, y?: U): C; } >new : (x: T, y?: U) => C >T : T >U : U @@ -143,17 +143,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T, y?: U) => C; }): any; (x: { new: (x: T, y?: U) => C; }): any; } ->x : { new: (x: T, y?: U) => C; } ->b : { new: (x: T, y?: U) => C; } +>foo4 : { (x: { new(x: T, y?: U): C; }): any; (x: { new(x: T, y?: U): C; }): any; } +>x : { new(x: T, y?: U): C; } +>b : { new(x: T, y?: U): C; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T, y?: U) => C; }): any; (x: { new: (x: T, y?: U) => C; }): any; } ->x : { new: (x: T, y?: U) => C; } ->b : { new: (x: T, y?: U) => C; } +>foo4 : { (x: { new(x: T, y?: U): C; }): any; (x: { new(x: T, y?: U): C; }): any; } +>x : { new(x: T, y?: U): C; } +>b : { new(x: T, y?: U): C; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T, y?: U) => C; }): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo4 : { (x: { new(x: T, y?: U): C; }): any; (x: { new(x: T, y?: U): C; }): any; } >x : any function foo8(x: B); @@ -199,17 +199,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T, y?: U): C; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T, y?: U) => C; }): any; } ->x : { new: (x: T, y?: U) => C; } ->b : { new: (x: T, y?: U) => C; } +>foo11 : { (x: B): any; (x: { new(x: T, y?: U): C; }): any; } +>x : { new(x: T, y?: U): C; } +>b : { new(x: T, y?: U): C; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T, y?: U): C; }): any; } >x : any function foo12(x: I); @@ -255,16 +255,16 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T, y?: U): C; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T, y?: U) => C; }): any; } ->x : { new: (x: T, y?: U) => C; } ->b : { new: (x: T, y?: U) => C; } +>foo14 : { (x: I): any; (x: { new(x: T, y?: U): C; }): any; } +>x : { new(x: T, y?: U): C; } +>b : { new(x: T, y?: U): C; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T, y?: U): C; }): any; } >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types index 9c8da5a6921..f21ccc15abb 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types @@ -70,8 +70,8 @@ var a: { new (x: T, y?: U): B }; >U : U var b = { new(x: T, y: U) { return new C(x, y); } }; // not a construct signature, function called new ->b : { new: (x: T, y: U) => C; } ->{ new(x: T, y: U) { return new C(x, y); } } : { new: (x: T, y: U) => C; } +>b : { new(x: T, y: U): C; } +>{ new(x: T, y: U) { return new C(x, y); } } : { new(x: T, y: U): C; } >new : (x: T, y: U) => C >T : T >U : U @@ -143,17 +143,17 @@ function foo3(x: any) { } >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T, y: U) => C; }): any; (x: { new: (x: T, y: U) => C; }): any; } ->x : { new: (x: T, y: U) => C; } ->b : { new: (x: T, y: U) => C; } +>foo4 : { (x: { new(x: T, y: U): C; }): any; (x: { new(x: T, y: U): C; }): any; } +>x : { new(x: T, y: U): C; } +>b : { new(x: T, y: U): C; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T, y: U) => C; }): any; (x: { new: (x: T, y: U) => C; }): any; } ->x : { new: (x: T, y: U) => C; } ->b : { new: (x: T, y: U) => C; } +>foo4 : { (x: { new(x: T, y: U): C; }): any; (x: { new(x: T, y: U): C; }): any; } +>x : { new(x: T, y: U): C; } +>b : { new(x: T, y: U): C; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T, y: U) => C; }): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo4 : { (x: { new(x: T, y: U): C; }): any; (x: { new(x: T, y: U): C; }): any; } >x : any function foo8(x: B); @@ -199,17 +199,17 @@ function foo10(x: any) { } >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T, y: U): C; }): any; } >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T, y: U) => C; }): any; } ->x : { new: (x: T, y: U) => C; } ->b : { new: (x: T, y: U) => C; } +>foo11 : { (x: B): any; (x: { new(x: T, y: U): C; }): any; } +>x : { new(x: T, y: U): C; } +>b : { new(x: T, y: U): C; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo11 : { (x: B): any; (x: { new(x: T, y: U): C; }): any; } >x : any function foo12(x: I); @@ -255,16 +255,16 @@ function foo13(x: any) { } >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T, y: U): C; }): any; } >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T, y: U) => C; }): any; } ->x : { new: (x: T, y: U) => C; } ->b : { new: (x: T, y: U) => C; } +>foo14 : { (x: I): any; (x: { new(x: T, y: U): C; }): any; } +>x : { new(x: T, y: U): C; } +>b : { new(x: T, y: U): C; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo14 : { (x: I): any; (x: { new(x: T, y: U): C; }): any; } >x : any diff --git a/tests/baselines/reference/parametersWithNoAnnotationAreAny.types b/tests/baselines/reference/parametersWithNoAnnotationAreAny.types index ee88697a82a..0424a169331 100644 --- a/tests/baselines/reference/parametersWithNoAnnotationAreAny.types +++ b/tests/baselines/reference/parametersWithNoAnnotationAreAny.types @@ -58,8 +58,8 @@ var a: { } var b = { ->b : { foo: (x: any) => any; a: (x: any) => any; b: (x: any) => any; } ->{ foo(x) { return x; }, a: function foo(x) { return x; }, b: (x) => x} : { foo: (x: any) => any; a: (x: any) => any; b: (x: any) => any; } +>b : { foo(x: any): any; a: (x: any) => any; b: (x: any) => any; } +>{ foo(x) { return x; }, a: function foo(x) { return x; }, b: (x) => x} : { foo(x: any): any; a: (x: any) => any; b: (x: any) => any; } foo(x) { >foo : (x: any) => any diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment1.types b/tests/baselines/reference/parserFunctionPropertyAssignment1.types index 9b1bdcd8d9f..1b552cdfefd 100644 --- a/tests/baselines/reference/parserFunctionPropertyAssignment1.types +++ b/tests/baselines/reference/parserFunctionPropertyAssignment1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment1.ts === var v = { foo() { } }; ->v : { foo: () => void; } ->{ foo() { } } : { foo: () => void; } +>v : { foo(): void; } +>{ foo() { } } : { foo(): void; } >foo : () => void diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment2.types b/tests/baselines/reference/parserFunctionPropertyAssignment2.types index ab5dd3fdbaa..747b66978af 100644 --- a/tests/baselines/reference/parserFunctionPropertyAssignment2.types +++ b/tests/baselines/reference/parserFunctionPropertyAssignment2.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment2.ts === var v = { 0() { } }; ->v : { 0: () => void; } ->{ 0() { } } : { 0: () => void; } +>v : { 0(): void; } +>{ 0() { } } : { 0(): void; } diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment3.types b/tests/baselines/reference/parserFunctionPropertyAssignment3.types index e245676e5f2..9fb2bb45fef 100644 --- a/tests/baselines/reference/parserFunctionPropertyAssignment3.types +++ b/tests/baselines/reference/parserFunctionPropertyAssignment3.types @@ -1,5 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment3.ts === var v = { "foo"() { } }; ->v : { "foo": () => void; } ->{ "foo"() { } } : { "foo": () => void; } +>v : { "foo"(): void; } +>{ "foo"() { } } : { "foo"(): void; } diff --git a/tests/baselines/reference/parserFunctionPropertyAssignment4.types b/tests/baselines/reference/parserFunctionPropertyAssignment4.types index 38fb2aadf70..6ab031518d4 100644 --- a/tests/baselines/reference/parserFunctionPropertyAssignment4.types +++ b/tests/baselines/reference/parserFunctionPropertyAssignment4.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/PropertyAssignments/parserFunctionPropertyAssignment4.ts === var v = { 0() { } }; ->v : { 0: () => void; } ->{ 0() { } } : { 0: () => void; } +>v : { 0(): void; } +>{ 0() { } } : { 0(): void; } >T : T diff --git a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.types b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.types index 7f5768923c5..4644782c551 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.types +++ b/tests/baselines/reference/sourceMapValidationFunctionPropertyAssignment.types @@ -1,6 +1,6 @@ === tests/cases/compiler/sourceMapValidationFunctionPropertyAssignment.ts === var x = { n() { } }; ->x : { n: () => void; } ->{ n() { } } : { n: () => void; } +>x : { n(): void; } +>{ n() { } } : { n(): void; } >n : () => void diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt index e4e8de59185..bdb122f6108 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt @@ -24,7 +24,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(71,5): error TS2411: Property 'foo' of type '() => string' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(73,5): error TS2411: Property '"4.0"' of type 'number' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(74,5): error TS2411: Property 'f' of type 'MyString' is not assignable to string index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'. Index signatures are incompatible. Type 'string | number | MyString | (() => void)' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -160,7 +160,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: string; } = { ~ -!!! error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo: () => string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Type '{ [x: string]: string | number | MyString | (() => void); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'string | number | MyString | (() => void)' is not assignable to type 'string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/thisInObjectLiterals.types b/tests/baselines/reference/thisInObjectLiterals.types index f0e54ef52ee..d3853389a9e 100644 --- a/tests/baselines/reference/thisInObjectLiterals.types +++ b/tests/baselines/reference/thisInObjectLiterals.types @@ -29,8 +29,8 @@ class MyClass { //type of 'this' in an object literal property of a function type is Any var obj = { ->obj : { f: () => any; } ->{ f() { return this.spaaace; }} : { f: () => any; } +>obj : { f(): any; } +>{ f() { return this.spaaace; }} : { f(): any; } f() { >f : () => any @@ -42,6 +42,6 @@ var obj = { } }; var obj: { f: () => any; }; ->obj : { f: () => any; } +>obj : { f(): any; } >f : () => any diff --git a/tests/baselines/reference/throwInEnclosingStatements.types b/tests/baselines/reference/throwInEnclosingStatements.types index 52a49aadf37..dc5b8fb76a5 100644 --- a/tests/baselines/reference/throwInEnclosingStatements.types +++ b/tests/baselines/reference/throwInEnclosingStatements.types @@ -83,8 +83,8 @@ class C { } var aa = { ->aa : { id: number; biz: () => void; } ->{ id:12, biz() { throw this; }} : { id: number; biz: () => void; } +>aa : { id: number; biz(): void; } +>{ id:12, biz() { throw this; }} : { id: number; biz(): void; } id:12, >id : number diff --git a/tests/baselines/reference/typeGuardsObjectMethods.types b/tests/baselines/reference/typeGuardsObjectMethods.types index ad8c9237760..ecb4b8083ea 100644 --- a/tests/baselines/reference/typeGuardsObjectMethods.types +++ b/tests/baselines/reference/typeGuardsObjectMethods.types @@ -14,8 +14,8 @@ var var1: string | number; >var1 : string | number var obj1 = { ->obj1 : { method: (param: string | number) => string | number; prop: string | number; } ->{ // Inside method method(param: string | number) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string // parameters in function declaration num = typeof param === "string" && param.length; // string return strOrNum; }, get prop() { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string return strOrNum; }, set prop(param: string | number) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string // parameters in function declaration num = typeof param === "string" && param.length; // string }} : { method: (param: string | number) => string | number; prop: string | number; } +>obj1 : { method(param: string | number): string | number; prop: string | number; } +>{ // Inside method method(param: string | number) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string // parameters in function declaration num = typeof param === "string" && param.length; // string return strOrNum; }, get prop() { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string return strOrNum; }, set prop(param: string | number) { // global vars in function declaration num = typeof var1 === "string" && var1.length; // string // variables in function declaration var var2: string | number; num = typeof var2 === "string" && var2.length; // string // parameters in function declaration num = typeof param === "string" && param.length; // string }} : { method(param: string | number): string | number; prop: string | number; } // Inside method method(param: string | number) { @@ -152,12 +152,12 @@ strOrNum = typeof obj1.method(strOrNum) === "string" && obj1.method(strOrNum); >typeof obj1.method(strOrNum) : string >obj1.method(strOrNum) : string | number >obj1.method : (param: string | number) => string | number ->obj1 : { method: (param: string | number) => string | number; prop: string | number; } +>obj1 : { method(param: string | number): string | number; prop: string | number; } >method : (param: string | number) => string | number >strOrNum : string | number >obj1.method(strOrNum) : string | number >obj1.method : (param: string | number) => string | number ->obj1 : { method: (param: string | number) => string | number; prop: string | number; } +>obj1 : { method(param: string | number): string | number; prop: string | number; } >method : (param: string | number) => string | number >strOrNum : string | number @@ -169,9 +169,9 @@ strOrNum = typeof obj1.prop === "string" && obj1.prop; >typeof obj1.prop === "string" : boolean >typeof obj1.prop : string >obj1.prop : string | number ->obj1 : { method: (param: string | number) => string | number; prop: string | number; } +>obj1 : { method(param: string | number): string | number; prop: string | number; } >prop : string | number >obj1.prop : string | number ->obj1 : { method: (param: string | number) => string | number; prop: string | number; } +>obj1 : { method(param: string | number): string | number; prop: string | number; } >prop : string | number