From b58ac4abf2d58d6309274c22762e2196789476d9 Mon Sep 17 00:00:00 2001 From: Titian Cernicova-Dragomir Date: Mon, 11 Nov 2024 20:15:29 +0200 Subject: [PATCH] Extract function types from function and arrow expressions. (#60234) --- src/compiler/checker.ts | 3 +- src/compiler/expressionToTypeNode.ts | 18 +- .../reference/arrowFunctionExpressions.types | 20 +-- .../capturedParametersInInitializers1.types | 2 +- .../collisionSuperAndParameter.types | 20 +-- ...isionThisExpressionAndNameResolution.types | 2 +- .../collisionThisExpressionAndParameter.types | 14 +- ...AndPropertyNameAsConstuctorParameter.types | 16 +- tests/baselines/reference/commentsFunction.js | 6 +- .../contextualSignatureInstantiation2.types | 4 +- .../contextualTypingOfAccessors.types | 4 +- .../reference/declFileTypeofFunction.js | 4 +- ...clarationEmitArrowFunctionNoRenaming.types | 4 +- ...declarationEmitBindingPatternsUnused.types | 2 +- ...clarationEmitClassMemberNameConflict.types | 8 +- ...ed(exactoptionalpropertytypes=false).types | 6 +- ...sed(exactoptionalpropertytypes=true).types | 6 +- ...arationEmitResolveTypesIfNotReusable.types | 4 +- .../declarationEmitTypeofRest.errors.txt | 23 --- .../reference/declarationEmitTypeofRest.js | 13 +- .../decoratedBlockScopedClass1.types | 4 +- .../decoratedBlockScopedClass2.types | 4 +- .../decoratedBlockScopedClass3.types | 6 +- ...orInstantiateModulesInFunctionBodies.types | 4 +- ...indingElementInParameterDeclaration1.types | 2 +- ...indingElementInParameterDeclaration2.types | 2 +- ...mitArrowFunctionWhenUsingArguments08.types | 4 +- ...rrowFunctionWhenUsingArguments08_ES6.types | 4 +- .../emitThisInObjectLiteralGetter.types | 4 +- .../esDecorators-contextualTypes.2.types | 4 +- .../fatarrowfunctionsOptionalArgs.types | 4 +- ...RefsForFunctionExpression01.baseline.jsonc | 154 +++++++++++++++++- .../functionExpressionReturningItself.js | 2 +- .../reference/generatorTypeCheck39.types | 4 +- .../genericCallWithObjectTypeArgs2.types | 6 +- ...allWithObjectTypeArgsAndConstraints4.types | 24 +-- ...allWithObjectTypeArgsAndConstraints5.types | 8 +- ...thinOwnBodyCastTypeParameterIdentity.types | 12 +- .../reference/genericContextualTypes1.types | 20 +-- .../reference/genericFunctionInference1.types | 14 +- .../reference/genericRestParameters1.types | 14 +- .../genericTypeParameterEquivalence2.types | 2 +- .../reference/inferTypePredicates.js | 4 +- tests/baselines/reference/inferTypes1.types | 4 +- .../instantiationExpressionErrorNoCrash.types | 6 +- .../intersectionTypeInference1.types | 6 +- .../reference/intraExpressionInferences.types | 8 +- .../isolatedDeclarationsAddUndefined.types | 4 +- .../jsdocSignatureOnReturnedFunction.types | 4 +- .../reference/keyofAndIndexedAccess.types | 4 +- .../narrowingPastLastAssignment.types | 4 +- .../reference/nestedRecursiveLambda.types | 14 +- ...meterInitializersForwardReferencing1.types | 2 +- ...rInitializersForwardReferencing1_es6.types | 2 +- .../parameterReferenceInInitializer2.types | 2 +- .../parseErrorIncorrectReturnToken.types | 4 +- ...ikeDeferredInferenceAllowsAssignment.types | 12 +- .../reference/returnStatement1.types | 2 +- ...erseMappedTypeIntersectionConstraint.types | 6 +- .../reverseMappedTypeLimitedConstraint.types | 6 +- .../reference/spreadParameterTupleType.js | 4 +- .../spreadParameterTupleType.symbols | 4 +- .../reference/spreadParameterTupleType.types | 8 +- .../subtypingWithCallSignatures2.types | 78 ++++----- .../subtypingWithCallSignatures3.types | 52 +++--- ...edTemplateStringsWithCurriedFunction.types | 16 +- .../reference/templateLiteralTypes1.types | 6 +- .../thisExpressionInIndexExpression.types | 2 +- .../reference/thisTypeInClasses.types | 4 +- .../reference/trackedSymbolsNoCrash.types | 4 +- .../transpile/declarationRestParameters.d.ts | 51 ++---- .../typeParameterConstModifiers.types | 12 +- .../typePredicateFreshLiteralWidening.types | 10 +- .../reference/unusedParametersInLambda1.types | 2 +- .../reference/unusedParametersInLambda2.types | 2 +- tests/baselines/reference/variadicTuples1.js | 2 +- .../baselines/reference/variadicTuples1.types | 38 ++--- .../compiler/spreadParameterTupleType.ts | 4 +- 78 files changed, 489 insertions(+), 385 deletions(-) delete mode 100644 tests/baselines/reference/declarationEmitTypeofRest.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a096d76c17a..cc8a7f7428f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6193,8 +6193,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { enterNewScope(context, node) { if (isFunctionLike(node) || isJSDocSignature(node)) { const signature = getSignatureFromDeclaration(node); - const expandedParams = getExpandedParameters(signature, /*skipUnionExpanding*/ true)[0]; - return enterNewScope(context as NodeBuilderContext, node, expandedParams, signature.typeParameters); + return enterNewScope(context as NodeBuilderContext, node, signature.parameters, signature.typeParameters); } else { const typeParameters = isConditionalTypeNode(node) ? getInferTypeParameters(node) : diff --git a/src/compiler/expressionToTypeNode.ts b/src/compiler/expressionToTypeNode.ts index 30a154f6369..7f54ab49406 100644 --- a/src/compiler/expressionToTypeNode.ts +++ b/src/compiler/expressionToTypeNode.ts @@ -969,14 +969,16 @@ export function createSyntacticTypeNodeBuilder( return failed; } function typeFromFunctionLikeExpression(fnNode: FunctionExpression | ArrowFunction, context: SyntacticTypeNodeBuilderContext) { - // Disable any inference fallback since we won't actually use the resulting type and we don't want to generate errors - const oldNoInferenceFallback = context.noInferenceFallback; - context.noInferenceFallback = true; - createReturnFromSignature(fnNode, /*symbol*/ undefined, context); - reuseTypeParameters(fnNode.typeParameters, context); - fnNode.parameters.map(p => ensureParameter(p, context)); - context.noInferenceFallback = oldNoInferenceFallback; - return notImplemented; + const returnType = createReturnFromSignature(fnNode, /*symbol*/ undefined, context); + const typeParameters = reuseTypeParameters(fnNode.typeParameters, context); + const parameters = fnNode.parameters.map(p => ensureParameter(p, context)); + return syntacticResult( + factory.createFunctionTypeNode( + typeParameters, + parameters, + returnType, + ), + ); } function canGetTypeFromArrayLiteral(arrayLiteral: ArrayLiteralExpression, context: SyntacticTypeNodeBuilderContext, isConstContext: boolean) { if (!isConstContext) { diff --git a/tests/baselines/reference/arrowFunctionExpressions.types b/tests/baselines/reference/arrowFunctionExpressions.types index 8bf8f07feb2..cf5973fc84e 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.types +++ b/tests/baselines/reference/arrowFunctionExpressions.types @@ -245,15 +245,15 @@ class MyClass { // Arrow function used in arrow function var arrrr = () => (m: number) => () => (n: number) => m + n; >arrrr : () => (m: number) => () => (n: number) => number -> : ^^^^^^^ ^^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ >() => (m: number) => () => (n: number) => m + n : () => (m: number) => () => (n: number) => number -> : ^^^^^^^ ^^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ >(m: number) => () => (n: number) => m + n : (m: number) => () => (n: number) => number -> : ^ ^^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^^^ +> : ^ ^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ >m : number > : ^^^^^^ >() => (n: number) => m + n : () => (n: number) => number -> : ^^^^^^^ ^^ ^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^ >(n: number) => m + n : (n: number) => number > : ^ ^^ ^^^^^^^^^^^ >n : number @@ -273,11 +273,11 @@ var e = arrrr()(3)()(4); >arrrr()(3)() : (n: number) => number > : ^ ^^ ^^^^^^^^^^^ >arrrr()(3) : () => (n: number) => number -> : ^^^^^^^ ^^ ^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^ >arrrr() : (m: number) => () => (n: number) => number -> : ^ ^^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^^^ +> : ^ ^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ >arrrr : () => (m: number) => () => (n: number) => number -> : ^^^^^^^ ^^ ^^^^^^^^^^^^ ^^ ^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ >3 : 3 > : ^ >4 : 4 @@ -294,9 +294,9 @@ function someFn() { var arr = (n: number) => (p: number) => p * n; >arr : (n: number) => (p: number) => number -> : ^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^ >(n: number) => (p: number) => p * n : (n: number) => (p: number) => number -> : ^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^ >n : number > : ^^^^^^ >(p: number) => p * n : (p: number) => number @@ -320,7 +320,7 @@ function someFn() { >arr(3) : (p: number) => number > : ^ ^^ ^^^^^^^^^^^ >arr : (n: number) => (p: number) => number -> : ^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^ >3 : 3 > : ^ >4 : 4 diff --git a/tests/baselines/reference/capturedParametersInInitializers1.types b/tests/baselines/reference/capturedParametersInInitializers1.types index 62ff31870c5..ff287cc2aad 100644 --- a/tests/baselines/reference/capturedParametersInInitializers1.types +++ b/tests/baselines/reference/capturedParametersInInitializers1.types @@ -32,7 +32,7 @@ function foo1(y = class {c = x}, x = 1) { // ok - used in file function foo2(y = function(x: typeof z) {}, z = 1) { >foo2 : (y?: (x: typeof z) => void, z?: number) => void -> : ^ ^^^^ ^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ >y : (x: typeof z) => void > : ^ ^^ ^^^^^^^^^ >function(x: typeof z) {} : (x: typeof z) => void diff --git a/tests/baselines/reference/collisionSuperAndParameter.types b/tests/baselines/reference/collisionSuperAndParameter.types index 89a68d08615..5abe135cd30 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.types +++ b/tests/baselines/reference/collisionSuperAndParameter.types @@ -11,9 +11,9 @@ class Foo { var lamda = (_super: number) => { // No Error >lamda : (_super: number) => (x: any) => this -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^ >(_super: number) => { // No Error return x => this; // New scope. So should inject new _this capture } : (_super: number) => (x: any) => this -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^ >_super : number > : ^^^^^^ @@ -33,9 +33,9 @@ class Foo { var lambda = () => { >lambda : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ >() => { return x => this; // New scope. So should inject new _this capture } : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return x => this; // New scope. So should inject new _this capture >x => this : (x: any) => this @@ -64,9 +64,9 @@ class Foo2 extends Foo { var lamda = (_super: number) => { // Error >lamda : (_super: number) => (x: any) => this -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^ >(_super: number) => { // Error return x => this; // New scope. So should inject new _this capture } : (_super: number) => (x: any) => this -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^ >_super : number > : ^^^^^^ @@ -86,9 +86,9 @@ class Foo2 extends Foo { var lambda = () => { >lambda : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ >() => { return x => this; // New scope. So should inject new _this capture } : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return x => this; // New scope. So should inject new _this capture >x => this : (x: any) => this @@ -218,9 +218,9 @@ class Foo4 extends Foo { var lambda = () => { >lambda : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ >() => { return x => this; // New scope. So should inject new _this capture } : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return x => this; // New scope. So should inject new _this capture >x => this : (x: any) => this diff --git a/tests/baselines/reference/collisionThisExpressionAndNameResolution.types b/tests/baselines/reference/collisionThisExpressionAndNameResolution.types index 0d19a7433a8..f5be0d8e65e 100644 --- a/tests/baselines/reference/collisionThisExpressionAndNameResolution.types +++ b/tests/baselines/reference/collisionThisExpressionAndNameResolution.types @@ -26,7 +26,7 @@ class Foo { function inner() { >inner : () => (x: any) => any -> : ^^^^^^^ ^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^ console.log(_this); // Error as this doesnt not resolve to user defined _this >console.log(_this) : any diff --git a/tests/baselines/reference/collisionThisExpressionAndParameter.types b/tests/baselines/reference/collisionThisExpressionAndParameter.types index 2b2b0f1c9fe..fe3d1066117 100644 --- a/tests/baselines/reference/collisionThisExpressionAndParameter.types +++ b/tests/baselines/reference/collisionThisExpressionAndParameter.types @@ -17,7 +17,7 @@ class Foo { function inner(_this: number) { // Error >inner : (_this: number) => (x: any) => any -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^ >_this : number > : ^^^^^^ @@ -34,9 +34,9 @@ class Foo { var lamda = (_this: number) => { // Error >lamda : (_this: number) => (x: any) => this -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^ >(_this: number) => { // Error return x => this; // New scope. So should inject new _this capture } : (_this: number) => (x: any) => this -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^ >_this : number > : ^^^^^^ @@ -56,9 +56,9 @@ class Foo { var lambda = () => { >lambda : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ >() => { return x => this; // New scope. So should inject new _this capture } : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return x => this; // New scope. So should inject new _this capture >x => this : (x: any) => this @@ -257,9 +257,9 @@ class Foo3 { var lambda = () => { >lambda : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ >() => { return x => this; // New scope. So should inject new _this capture } : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return x => this; // New scope. So should inject new _this capture >x => this : (x: any) => this diff --git a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.types b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.types index 42ef5b77e46..91479f0c4d3 100644 --- a/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.types +++ b/tests/baselines/reference/collisionThisExpressionAndPropertyNameAsConstuctorParameter.types @@ -11,9 +11,9 @@ class Foo2 { var lambda = () => { >lambda : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ >() => { return x => this; // New scope. So should inject new _this capture } : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return x => this; // New scope. So should inject new _this capture >x => this : (x: any) => this @@ -35,9 +35,9 @@ class Foo3 { var lambda = () => { >lambda : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ >() => { return x => this; // New scope. So should inject new _this capture } : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return x => this; // New scope. So should inject new _this capture >x => this : (x: any) => this @@ -66,9 +66,9 @@ class Foo4 { var lambda = () => { >lambda : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ >() => { return x => this; // New scope. So should inject new _this capture } : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return x => this; // New scope. So should inject new _this capture >x => this : (x: any) => this @@ -97,9 +97,9 @@ class Foo5 { var lambda = () => { >lambda : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ >() => { return x => this; // New scope. So should inject new _this capture } : () => (x: any) => this -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return x => this; // New scope. So should inject new _this capture >x => this : (x: any) => this diff --git a/tests/baselines/reference/commentsFunction.js b/tests/baselines/reference/commentsFunction.js index 852490d0d83..bc1e901995c 100644 --- a/tests/baselines/reference/commentsFunction.js +++ b/tests/baselines/reference/commentsFunction.js @@ -111,9 +111,9 @@ b: number): void; /** fooFunc * comment */ -declare var fooFunc: (b: string) => string; -declare var lambdaFoo: (a: number, b: number) => number; -declare var lambddaNoVarComment: (a: number, b: number) => number; +declare var fooFunc: (/** fooFunctionValue param */ b: string) => string; +declare var lambdaFoo: (/**param a*/ a: number, /**param b*/ b: number) => number; +declare var lambddaNoVarComment: (/**param a*/ a: number, /**param b*/ b: number) => number; declare function blah(a: string): void; declare function blah2(a: string): void; declare function blah3(a: string): void; diff --git a/tests/baselines/reference/contextualSignatureInstantiation2.types b/tests/baselines/reference/contextualSignatureInstantiation2.types index fac97d12fd2..234c4c03cf1 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation2.types +++ b/tests/baselines/reference/contextualSignatureInstantiation2.types @@ -18,11 +18,11 @@ var dot: (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S; dot = (f: (_: T) => S) => (g: (_: U) => T): (r:U) => S => (x) => f(g(x)); >dot = (f: (_: T) => S) => (g: (_: U) => T): (r:U) => S => (x) => f(g(x)) : (f: (_: T) => S) => (g: (_: U) => T) => (r: U) => S -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >dot : (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S > : ^ ^^ ^^ ^^ ^^^^^ >(f: (_: T) => S) => (g: (_: U) => T): (r:U) => S => (x) => f(g(x)) : (f: (_: T) => S) => (g: (_: U) => T) => (r: U) => S -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >f : (_: T) => S > : ^ ^^ ^^^^^ >_ : T diff --git a/tests/baselines/reference/contextualTypingOfAccessors.types b/tests/baselines/reference/contextualTypingOfAccessors.types index fe8faed1bf2..6c0553f064c 100644 --- a/tests/baselines/reference/contextualTypingOfAccessors.types +++ b/tests/baselines/reference/contextualTypingOfAccessors.types @@ -16,11 +16,11 @@ var x: { x = { >x = { get foo() { return (n)=>n }, set foo(x) {}} : { foo: (n: any) => any; } -> : ^^^^^^^^ ^^^^^^^^^^^^^^^^ +> : ^^^^^^^^ ^^^^^^^^^^^^^^ >x : { foo: (x: number) => number; } > : ^^^^^^^ ^^^ >{ get foo() { return (n)=>n }, set foo(x) {}} : { foo: (n: any) => any; } -> : ^^^^^^^^ ^^^^^^^^^^^^^^^^ +> : ^^^^^^^^ ^^^^^^^^^^^^^^ get foo() { >foo : (n: any) => any diff --git a/tests/baselines/reference/declFileTypeofFunction.js b/tests/baselines/reference/declFileTypeofFunction.js index 18677389f33..bc2e82a5dfa 100644 --- a/tests/baselines/reference/declFileTypeofFunction.js +++ b/tests/baselines/reference/declFileTypeofFunction.js @@ -70,6 +70,6 @@ declare function b1(): typeof b1; declare function foo(): typeof foo; declare var foo1: typeof foo; declare var foo2: typeof foo; -declare var foo3: () => /*elided*/ any; -declare var x: () => /*elided*/ any; +declare var foo3: () => () => /*elided*/ any; +declare var x: () => () => /*elided*/ any; declare function foo5(x: number): (x: number) => number; diff --git a/tests/baselines/reference/declarationEmitArrowFunctionNoRenaming.types b/tests/baselines/reference/declarationEmitArrowFunctionNoRenaming.types index e32387d3034..a2a24ee132d 100644 --- a/tests/baselines/reference/declarationEmitArrowFunctionNoRenaming.types +++ b/tests/baselines/reference/declarationEmitArrowFunctionNoRenaming.types @@ -22,11 +22,11 @@ export type BoundedInteger< export const toBoundedInteger = >toBoundedInteger : (bounds: { lowerBound: LowerBound; upperBound: UpperBound; }) => (n: number) => BoundedInteger -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ (bounds: { >(bounds: { lowerBound: LowerBound; upperBound: UpperBound; }) => ( n: number ): BoundedInteger => // Implementation doesn't matter here ({} as any) : (bounds: { lowerBound: LowerBound; upperBound: UpperBound; }) => (n: number) => BoundedInteger -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ >bounds : { lowerBound: LowerBound; upperBound: UpperBound; } > : ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^ diff --git a/tests/baselines/reference/declarationEmitBindingPatternsUnused.types b/tests/baselines/reference/declarationEmitBindingPatternsUnused.types index 69b207c3079..3f68149ee43 100644 --- a/tests/baselines/reference/declarationEmitBindingPatternsUnused.types +++ b/tests/baselines/reference/declarationEmitBindingPatternsUnused.types @@ -169,7 +169,7 @@ function referencedInInferredType({ name: alias }: Named) { function referencedInNestedFunction({ name: alias }: Named) { >referencedInNestedFunction : ({ name: alias }: Named) => (p: typeof alias) => void -> : ^ ^^ ^^^^^^ ^^ ^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^ >name : any > : ^^^ >alias : string diff --git a/tests/baselines/reference/declarationEmitClassMemberNameConflict.types b/tests/baselines/reference/declarationEmitClassMemberNameConflict.types index 185a6f7838d..5547bba484a 100644 --- a/tests/baselines/reference/declarationEmitClassMemberNameConflict.types +++ b/tests/baselines/reference/declarationEmitClassMemberNameConflict.types @@ -11,7 +11,7 @@ export class C1 { bar() { >bar : () => (t: typeof C1) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ return function (t: typeof C1) { >function (t: typeof C1) { } : (t: typeof C1) => void @@ -34,7 +34,7 @@ export class C2 { bar() { >bar : () => (t: typeof C2) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ return function (t: typeof C2) { >function (t: typeof C2) { } : (t: typeof C2) => void @@ -60,7 +60,7 @@ export class C3 { bar() { >bar : () => (t: typeof C3) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ return function (t: typeof C3) { >function (t: typeof C3) { } : (t: typeof C3) => void @@ -84,7 +84,7 @@ export class C4 { bar() { >bar : () => (t: typeof C4) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ return function (t: typeof C4) { >function (t: typeof C4) { } : (t: typeof C4) => void diff --git a/tests/baselines/reference/declarationEmitExactOptionalPropertyTypesNodeNotReused(exactoptionalpropertytypes=false).types b/tests/baselines/reference/declarationEmitExactOptionalPropertyTypesNodeNotReused(exactoptionalpropertytypes=false).types index 05a99feaa03..920a55e8332 100644 --- a/tests/baselines/reference/declarationEmitExactOptionalPropertyTypesNodeNotReused(exactoptionalpropertytypes=false).types +++ b/tests/baselines/reference/declarationEmitExactOptionalPropertyTypesNodeNotReused(exactoptionalpropertytypes=false).types @@ -35,9 +35,9 @@ type Out = InexactOptionals const foo = () => (x: Out & A) => null >foo : () => (x: Out & A) => null -> : ^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^ +> : ^ ^^^^^^^^^^^^^ ^^^^^^^^^ >() => (x: Out & A) => null : () => (x: Out & A) => null -> : ^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^ +> : ^ ^^^^^^^^^^^^^ ^^^^^^^^^ >(x: Out & A) => null : (x: Out & A) => null > : ^ ^^ ^^^^^^^^^ >x : { foo?: string | undefined; baz?: undefined; } & { bar: number; } & A @@ -49,5 +49,5 @@ export const baddts = foo() >foo() : (x: { foo?: string | undefined; baz?: undefined; } & { bar: number; }) => null > : ^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^ >foo : () => (x: Out & A) => null -> : ^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^ +> : ^ ^^^^^^^^^^^^^ ^^^^^^^^^ diff --git a/tests/baselines/reference/declarationEmitExactOptionalPropertyTypesNodeNotReused(exactoptionalpropertytypes=true).types b/tests/baselines/reference/declarationEmitExactOptionalPropertyTypesNodeNotReused(exactoptionalpropertytypes=true).types index 05a99feaa03..920a55e8332 100644 --- a/tests/baselines/reference/declarationEmitExactOptionalPropertyTypesNodeNotReused(exactoptionalpropertytypes=true).types +++ b/tests/baselines/reference/declarationEmitExactOptionalPropertyTypesNodeNotReused(exactoptionalpropertytypes=true).types @@ -35,9 +35,9 @@ type Out = InexactOptionals const foo = () => (x: Out & A) => null >foo : () => (x: Out & A) => null -> : ^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^ +> : ^ ^^^^^^^^^^^^^ ^^^^^^^^^ >() => (x: Out & A) => null : () => (x: Out & A) => null -> : ^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^ +> : ^ ^^^^^^^^^^^^^ ^^^^^^^^^ >(x: Out & A) => null : (x: Out & A) => null > : ^ ^^ ^^^^^^^^^ >x : { foo?: string | undefined; baz?: undefined; } & { bar: number; } & A @@ -49,5 +49,5 @@ export const baddts = foo() >foo() : (x: { foo?: string | undefined; baz?: undefined; } & { bar: number; }) => null > : ^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^ >foo : () => (x: Out & A) => null -> : ^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^ +> : ^ ^^^^^^^^^^^^^ ^^^^^^^^^ diff --git a/tests/baselines/reference/declarationEmitResolveTypesIfNotReusable.types b/tests/baselines/reference/declarationEmitResolveTypesIfNotReusable.types index 9df830887a4..4579c067ade 100644 --- a/tests/baselines/reference/declarationEmitResolveTypesIfNotReusable.types +++ b/tests/baselines/reference/declarationEmitResolveTypesIfNotReusable.types @@ -79,9 +79,9 @@ import * as d from './decl' export const f = {...d} >f : { o1: (o: "value of b") => void; o2: (o: "value of a") => void; o3: (o: "value of a") => void; o4: (o: "b" | "notNecessary") => void; } -> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >{...d} : { o1: (o: "value of b") => void; o2: (o: "value of a") => void; o3: (o: "value of a") => void; o4: (o: "b" | "notNecessary") => void; } -> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >d : typeof d > : ^^^^^^^^ diff --git a/tests/baselines/reference/declarationEmitTypeofRest.errors.txt b/tests/baselines/reference/declarationEmitTypeofRest.errors.txt deleted file mode 100644 index 671d90c0095..00000000000 --- a/tests/baselines/reference/declarationEmitTypeofRest.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -v2.ts(2,14): error TS2527: The inferred type of 'v2' references an inaccessible 'unique symbol' type. A type annotation is necessary. - - -==== v1.ts (0 errors) ==== - export const v1 = (...a: [n: "n", a: "a"]): { - /** r rest param */ - a: typeof a, - } => { - return null! - } - -==== v2.ts (1 errors) ==== - const n = Symbol(); - export const v2 = (...a: [n: "n", a: "a"]): { - ~~ -!!! error TS2527: The inferred type of 'v2' references an inaccessible 'unique symbol' type. A type annotation is necessary. - /** r rest param */ - a: typeof a, - /** module var */ - n: typeof n, - } => { - return null! - } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitTypeofRest.js b/tests/baselines/reference/declarationEmitTypeofRest.js index 58fd7016fec..a4d7a92dd62 100644 --- a/tests/baselines/reference/declarationEmitTypeofRest.js +++ b/tests/baselines/reference/declarationEmitTypeofRest.js @@ -31,7 +31,16 @@ export const v2 = (...a) => { //// [v1.d.ts] -export declare const v1: (n: "n", a: "a") => { +export declare const v1: (...a: [n: "n", a: "a"]) => { /** r rest param */ - a: [n: "n", a: "a"]; + a: typeof a; }; +//// [v2.d.ts] +declare const n: unique symbol; +export declare const v2: (...a: [n: "n", a: "a"]) => { + /** r rest param */ + a: typeof a; + /** module var */ + n: typeof n; +}; +export {}; diff --git a/tests/baselines/reference/decoratedBlockScopedClass1.types b/tests/baselines/reference/decoratedBlockScopedClass1.types index 47a19bafffc..641268c7bee 100644 --- a/tests/baselines/reference/decoratedBlockScopedClass1.types +++ b/tests/baselines/reference/decoratedBlockScopedClass1.types @@ -3,7 +3,7 @@ === a.ts === function decorator() { >decorator : () => (target: new (...args: any[]) => any) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ return (target: new (...args: any[]) => any) => {} >(target: new (...args: any[]) => any) => {} : (target: new (...args: any[]) => any) => void @@ -18,7 +18,7 @@ function decorator() { >decorator() : (target: new (...args: any[]) => any) => void > : ^ ^^ ^^^^^^^^^ >decorator : () => (target: new (...args: any[]) => any) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ class Foo { >Foo : Foo diff --git a/tests/baselines/reference/decoratedBlockScopedClass2.types b/tests/baselines/reference/decoratedBlockScopedClass2.types index 70bf8dc0c77..271242a6fa0 100644 --- a/tests/baselines/reference/decoratedBlockScopedClass2.types +++ b/tests/baselines/reference/decoratedBlockScopedClass2.types @@ -3,7 +3,7 @@ === a.ts === function decorator() { >decorator : () => (target: new (...args: any[]) => any) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ return (target: new (...args: any[]) => any) => {} >(target: new (...args: any[]) => any) => {} : (target: new (...args: any[]) => any) => void @@ -19,7 +19,7 @@ try { >decorator() : (target: new (...args: any[]) => any) => void > : ^ ^^ ^^^^^^^^^ >decorator : () => (target: new (...args: any[]) => any) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ class Foo { >Foo : Foo diff --git a/tests/baselines/reference/decoratedBlockScopedClass3.types b/tests/baselines/reference/decoratedBlockScopedClass3.types index 278663628cb..5018dcd3677 100644 --- a/tests/baselines/reference/decoratedBlockScopedClass3.types +++ b/tests/baselines/reference/decoratedBlockScopedClass3.types @@ -3,7 +3,7 @@ === a.ts === function decorator() { >decorator : () => (target: new (...args: any[]) => any) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ return (target: new (...args: any[]) => any) => {} >(target: new (...args: any[]) => any) => {} : (target: new (...args: any[]) => any) => void @@ -18,7 +18,7 @@ function decorator() { >decorator() : (target: new (...args: any[]) => any) => void > : ^ ^^ ^^^^^^^^^ >decorator : () => (target: new (...args: any[]) => any) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ class Foo { >Foo : Foo @@ -50,7 +50,7 @@ try { >decorator() : (target: new (...args: any[]) => any) => void > : ^ ^^ ^^^^^^^^^ >decorator : () => (target: new (...args: any[]) => any) => void -> : ^^^^^^^ ^^ ^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^ class Foo { >Foo : Foo diff --git a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types index 6bc3ddc2675..a060963cd35 100644 --- a/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types +++ b/tests/baselines/reference/decoratorInstantiateModulesInFunctionBodies.types @@ -15,7 +15,7 @@ import { test } from './a'; function filter(handler: any) { >filter : (handler: any) => (target: any, propertyKey: string) => void -> : ^ ^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^ ^^^^^^^^^ >handler : any return function (target: any, propertyKey: string) { @@ -37,7 +37,7 @@ class Wat { >filter(() => test == 'abc') : (target: any, propertyKey: string) => void > : ^ ^^ ^^ ^^ ^^^^^^^^^ >filter : (handler: any) => (target: any, propertyKey: string) => void -> : ^ ^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^ ^^^^^^^^^ >() => test == 'abc' : () => boolean > : ^^^^^^^^^^^^^ >test == 'abc' : boolean diff --git a/tests/baselines/reference/duplicateIdentifierBindingElementInParameterDeclaration1.types b/tests/baselines/reference/duplicateIdentifierBindingElementInParameterDeclaration1.types index e522c270b4e..0428b2813d9 100644 --- a/tests/baselines/reference/duplicateIdentifierBindingElementInParameterDeclaration1.types +++ b/tests/baselines/reference/duplicateIdentifierBindingElementInParameterDeclaration1.types @@ -79,7 +79,7 @@ function f6([f, ...f]) { } function f7(a, func = (a) => { return 1 }) { } // not error >f7 : (a: any, func?: (a: any) => number) => void -> : ^ ^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ >a : any > : ^^^ >func : (a: any) => number diff --git a/tests/baselines/reference/duplicateIdentifierBindingElementInParameterDeclaration2.types b/tests/baselines/reference/duplicateIdentifierBindingElementInParameterDeclaration2.types index f3bd4693815..5d86eb8582f 100644 --- a/tests/baselines/reference/duplicateIdentifierBindingElementInParameterDeclaration2.types +++ b/tests/baselines/reference/duplicateIdentifierBindingElementInParameterDeclaration2.types @@ -83,7 +83,7 @@ function f6([f, ...f]) { } function f7(a, func = (a) => { return 1 }){ } // not error >f7 : (a: any, func?: (a: any) => number) => void -> : ^ ^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ >a : any > : ^^^ >func : (a: any) => number diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types index c68e418bf65..b47b22daec4 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08.types @@ -8,9 +8,9 @@ function f(arguments) { var a = () => (arguments) => arguments; >a : () => (arguments: any) => any -> : ^^^^^^^ ^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^ >() => (arguments) => arguments : () => (arguments: any) => any -> : ^^^^^^^ ^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^ >(arguments) => arguments : (arguments: any) => any > : ^ ^^^^^^^^^^^^^ >arguments : any diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types index d1207c2a72b..0f6f1c03d64 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments08_ES6.types @@ -8,9 +8,9 @@ function f(arguments) { var a = () => (arguments) => arguments; >a : () => (arguments: any) => any -> : ^^^^^^^ ^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^ >() => (arguments) => arguments : () => (arguments: any) => any -> : ^^^^^^^ ^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^ >(arguments) => arguments : (arguments: any) => any > : ^ ^^^^^^^^^^^^^ >arguments : any diff --git a/tests/baselines/reference/emitThisInObjectLiteralGetter.types b/tests/baselines/reference/emitThisInObjectLiteralGetter.types index 82187319bd4..9b6084af634 100644 --- a/tests/baselines/reference/emitThisInObjectLiteralGetter.types +++ b/tests/baselines/reference/emitThisInObjectLiteralGetter.types @@ -3,9 +3,9 @@ === emitThisInObjectLiteralGetter.ts === const example = { >example : { readonly foo: (item: any) => any; } -> : ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ >{ get foo() { return item => this.bar(item); }} : { readonly foo: (item: any) => any; } -> : ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ get foo() { >foo : (item: any) => any diff --git a/tests/baselines/reference/esDecorators-contextualTypes.2.types b/tests/baselines/reference/esDecorators-contextualTypes.2.types index 8e662b83fdc..7daa7b43500 100644 --- a/tests/baselines/reference/esDecorators-contextualTypes.2.types +++ b/tests/baselines/reference/esDecorators-contextualTypes.2.types @@ -9,7 +9,7 @@ class C { >boundMethodLogger("Yadda", /*bound*/ true) : (target: (this: C) => void, context: ClassMethodDecoratorContext void>) => (this: C) => void > : ^ ^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ >boundMethodLogger : (source: string, bound?: boolean) => (target: (this: This, ...args: Args) => Return, context: ClassMethodDecoratorContext Return>) => ((this: This, ...args: Args) => Return) -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^ ^^ ^^^^^ >"Yadda" : "Yadda" > : ^^^^^^^ >true : true @@ -53,7 +53,7 @@ export { C }; function boundMethodLogger(source: string, bound = true) { >boundMethodLogger : (source: string, bound?: boolean) => (target: (this: This, ...args: Args) => Return, context: ClassMethodDecoratorContext Return>) => ((this: This, ...args: Args) => Return) -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^ ^^ ^^^^^ >source : string > : ^^^^^^ >bound : boolean diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgs.types b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.types index 789ae0f3933..39e1460dba6 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgs.types +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgs.types @@ -623,7 +623,7 @@ false ? null : (...arg: number[]) => 68; >a : any > : ^^^ >(b)=>(c)=>81 : (b: any) => (c: any) => number -> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^ >b : any > : ^^^ >(c)=>81 : (c: any) => number @@ -633,7 +633,7 @@ false ? null : (...arg: number[]) => 68; >81 : 81 > : ^^ >(c)=>(d)=>82 : (c: any) => (d: any) => number -> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^ >c : any > : ^^^ >(d)=>82 : (d: any) => number diff --git a/tests/baselines/reference/findAllRefsForFunctionExpression01.baseline.jsonc b/tests/baselines/reference/findAllRefsForFunctionExpression01.baseline.jsonc index 9e043f4399b..a9b11df74bb 100644 --- a/tests/baselines/reference/findAllRefsForFunctionExpression01.baseline.jsonc +++ b/tests/baselines/reference/findAllRefsForFunctionExpression01.baseline.jsonc @@ -16,7 +16,7 @@ "containerKind": "", "containerName": "", "kind": "local function", - "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: ...) => void): void", + "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: () => ...) => void): void", "displayParts": [ { "text": "(", @@ -154,6 +154,26 @@ "text": " ", "kind": "space" }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, { "text": "...", "kind": "text" @@ -218,7 +238,7 @@ "containerKind": "", "containerName": "", "kind": "local function", - "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: ...) => void): void", + "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: () => ...) => void): void", "displayParts": [ { "text": "(", @@ -356,6 +376,26 @@ "text": " ", "kind": "space" }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, { "text": "...", "kind": "text" @@ -420,7 +460,7 @@ "containerKind": "", "containerName": "", "kind": "local function", - "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: ...) => void): void", + "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: () => ...) => void): void", "displayParts": [ { "text": "(", @@ -558,6 +598,26 @@ "text": " ", "kind": "space" }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, { "text": "...", "kind": "text" @@ -622,7 +682,7 @@ "containerKind": "", "containerName": "", "kind": "local function", - "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: ...) => void): void", + "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: () => ...) => void): void", "displayParts": [ { "text": "(", @@ -760,6 +820,26 @@ "text": " ", "kind": "space" }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, { "text": "...", "kind": "text" @@ -824,7 +904,7 @@ "containerKind": "", "containerName": "", "kind": "local function", - "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: ...) => void): void", + "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: () => ...) => void): void", "displayParts": [ { "text": "(", @@ -962,6 +1042,26 @@ "text": " ", "kind": "space" }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, { "text": "...", "kind": "text" @@ -1026,7 +1126,7 @@ "containerKind": "", "containerName": "", "kind": "local function", - "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: ...) => void): void", + "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: () => ...) => void): void", "displayParts": [ { "text": "(", @@ -1164,6 +1264,26 @@ "text": " ", "kind": "space" }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, { "text": "...", "kind": "text" @@ -1228,7 +1348,7 @@ "containerKind": "", "containerName": "", "kind": "local function", - "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: ...) => void): void", + "name": "(local function) foo(a?: void, b?: () => (a?: void, b?: () => ...) => void): void", "displayParts": [ { "text": "(", @@ -1366,6 +1486,26 @@ "text": " ", "kind": "space" }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=>", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, { "text": "...", "kind": "text" diff --git a/tests/baselines/reference/functionExpressionReturningItself.js b/tests/baselines/reference/functionExpressionReturningItself.js index 621a881f701..d586748c30b 100644 --- a/tests/baselines/reference/functionExpressionReturningItself.js +++ b/tests/baselines/reference/functionExpressionReturningItself.js @@ -8,4 +8,4 @@ var x = function somefn() { return somefn; }; //// [functionExpressionReturningItself.d.ts] -declare var x: () => /*elided*/ any; +declare var x: () => () => /*elided*/ any; diff --git a/tests/baselines/reference/generatorTypeCheck39.types b/tests/baselines/reference/generatorTypeCheck39.types index c9da6e9618e..1c82d58f441 100644 --- a/tests/baselines/reference/generatorTypeCheck39.types +++ b/tests/baselines/reference/generatorTypeCheck39.types @@ -3,7 +3,7 @@ === generatorTypeCheck39.ts === function decorator(x: any) { >decorator : (x: any) => (y: any) => void -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^ >x : any > : ^^^ @@ -21,7 +21,7 @@ function* g() { >decorator(yield 0) : (y: any) => void > : ^ ^^^^^^^^^^^^^^ >decorator : (x: any) => (y: any) => void -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^ >yield 0 : any > : ^^^ >0 : 0 diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.types b/tests/baselines/reference/genericCallWithObjectTypeArgs2.types index 4d2825da3dd..de56297eacd 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.types @@ -105,7 +105,7 @@ var r2 = f({ x: new Base(), y: new Derived2() }); // {}[] function f2(a: { x: T; y: U }) { >f2 : (a: { x: T; y: U; }) => (x: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^^ >a : { x: T; y: U; } > : ^^^^^ ^^^^^ ^^^ >x : T @@ -132,7 +132,7 @@ var r3 = f2({ x: new Derived(), y: new Derived2() }); // Derived => Derived2 >f2({ x: new Derived(), y: new Derived2() }) : (x: Derived) => Derived2 > : ^ ^^^^^^^^^^^^^^^^^^^^^^ >f2 : (a: { x: T; y: U; }) => (x: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^^ >{ x: new Derived(), y: new Derived2() } : { x: Derived; y: Derived2; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : Derived @@ -168,7 +168,7 @@ var r4 = f2(i); // Base => Derived >f2(i) : (x: Base) => Derived > : ^ ^^^^^^^^^^^^^^^^^^ >f2 : (a: { x: T; y: U; }) => (x: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^^ >i : I > : ^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types index b0cf1ce86ab..f540f37df42 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types @@ -27,7 +27,7 @@ class D { function foo(t: T, t2: U) { >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >t : T > : ^ >t2 : U @@ -56,7 +56,7 @@ var r = foo(c, d); >foo(c, d) : (x: C) => D > : ^ ^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >c : C > : ^ >d : D @@ -68,7 +68,7 @@ var r2 = foo(d, c); // error because C does not extend D >foo(d, c) : (x: D) => D > : ^ ^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >d : D > : ^ >c : C @@ -80,7 +80,7 @@ var r3 = foo(c, { x: '', foo: c }); >foo(c, { x: '', foo: c }) : (x: C) => { x: string; foo: C; } > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >c : C > : ^ >{ x: '', foo: c } : { x: string; foo: C; } @@ -100,7 +100,7 @@ var r4 = foo(null, null); >foo(null, null) : (x: any) => any > : ^ ^^^^^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ var r5 = foo({}, null); >r5 : (x: {}) => any @@ -108,7 +108,7 @@ var r5 = foo({}, null); >foo({}, null) : (x: {}) => any > : ^ ^^^^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >{} : {} > : ^^ @@ -118,7 +118,7 @@ var r6 = foo(null, {}); >foo(null, {}) : (x: any) => {} > : ^ ^^^^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >{} : {} > : ^^ @@ -128,7 +128,7 @@ var r7 = foo({}, {}); >foo({}, {}) : (x: {}) => {} > : ^ ^^^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >{} : {} > : ^^ >{} : {} @@ -140,7 +140,7 @@ var r8 = foo(() => { }, () => { }); >foo(() => { }, () => { }) : (x: () => void) => () => void > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >() => { } : () => void > : ^^^^^^^^^^ >() => { } : () => void @@ -152,7 +152,7 @@ var r9 = foo(() => { }, () => 1); >foo(() => { }, () => 1) : (x: () => void) => () => number > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >() => { } : () => void > : ^^^^^^^^^^ >() => 1 : () => number @@ -170,7 +170,7 @@ function other() { >foo(c, d) : (x: C) => D > : ^ ^^^^^^^^^ >foo : (t: T_1, t2: U_1) => (x: T_1) => U_1 -> : ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >c : C > : ^ >d : D @@ -182,7 +182,7 @@ function other() { >foo(c, d) : (x: T) => U > : ^ ^^^^^^^^^ >foo : (t: T_1, t2: U_1) => (x: T_1) => U_1 -> : ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >c : C > : ^ >d : D diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.types index 6c82e41b5ff..072c2e96aa1 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.types @@ -27,7 +27,7 @@ class D { function foo(t: T, t2: U) { >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >t : T > : ^ >t2 : U @@ -56,7 +56,7 @@ var r2 = foo(d, c); // the constraints are self-referencing, no downstream error >foo(d, c) : (x: D) => D > : ^ ^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >d : D > : ^ >c : C @@ -68,7 +68,7 @@ var r9 = foo(() => 1, () => { }); // the constraints are self-referencing, no do >foo(() => 1, () => { }) : (x: () => number) => () => number > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >foo : (t: T, t2: U) => (x: T) => U -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >() => 1 : () => number > : ^^^^^^^^^^^^ >1 : 1 @@ -86,7 +86,7 @@ function other() { >foo(c, d) : (x: T) => U > : ^ ^^^^^^^^^ >foo : (t: T_1, t2: U_1) => (x: T_1) => U_1 -> : ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >c : C > : ^ >d : D diff --git a/tests/baselines/reference/genericCallWithinOwnBodyCastTypeParameterIdentity.types b/tests/baselines/reference/genericCallWithinOwnBodyCastTypeParameterIdentity.types index da5e47d5889..f8095e434ba 100644 --- a/tests/baselines/reference/genericCallWithinOwnBodyCastTypeParameterIdentity.types +++ b/tests/baselines/reference/genericCallWithinOwnBodyCastTypeParameterIdentity.types @@ -17,9 +17,9 @@ interface Thenable { const toThenable = (fn: (input: Input) => Result | Thenable) => >toThenable : (fn: (input: Input) => Result | Thenable) => (input: Input) => Thenable -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >(fn: (input: Input) => Result | Thenable) => (input: Input): Thenable => { const result = fn(input) return { then(onFulfilled: (value: Result) => V | Thenable) { return toThenable(onFulfilled)(result as Result) } }; } : (fn: (input: Input) => Result | Thenable) => (input: Input) => Thenable -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >fn : (input: Input) => Result | Thenable > : ^ ^^ ^^^^^ >input : Input @@ -59,7 +59,7 @@ const toThenable = (fn: (input: Input) => Result | ThenabletoThenable(onFulfilled) : (input: Result) => Thenable > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ >toThenable : (fn: (input: Input) => Result | Thenable) => (input: Input) => Thenable -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >onFulfilled : (value: Result) => V | Thenable > : ^ ^^ ^^^^^ >result as Result : Result @@ -72,9 +72,9 @@ const toThenable = (fn: (input: Input) => Result | Thenable(fn: (input: Input) => Result | Thenable) => >toThenableInferred : (fn: (input: Input) => Result | Thenable) => (input: Input) => Thenable -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >(fn: (input: Input) => Result | Thenable) => (input: Input): Thenable => { const result = fn(input) return { then(onFulfilled) { return toThenableInferred(onFulfilled)(result as Result) } }; } : (fn: (input: Input) => Result | Thenable) => (input: Input) => Thenable -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >fn : (input: Input) => Result | Thenable > : ^ ^^ ^^^^^ >input : Input @@ -112,7 +112,7 @@ const toThenableInferred = (fn: (input: Input) => Result | Thenab >toThenableInferred(onFulfilled) : (input: Result) => Thenable > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^ >toThenableInferred : (fn: (input: Input) => Result | Thenable) => (input: Input) => Thenable -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >onFulfilled : (value: Result) => V | Thenable > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >result as Result : Result diff --git a/tests/baselines/reference/genericContextualTypes1.types b/tests/baselines/reference/genericContextualTypes1.types index 8501eb750fa..d7a5de0c1d6 100644 --- a/tests/baselines/reference/genericContextualTypes1.types +++ b/tests/baselines/reference/genericContextualTypes1.types @@ -235,9 +235,9 @@ const f13: (x: Box) => T = compose(unbox, unlist); const arrayMap = (f: (x: T) => U) => (a: T[]) => a.map(f); >arrayMap : (f: (x: T) => U) => (a: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >(f: (x: T) => U) => (a: T[]) => a.map(f) : (f: (x: T) => U) => (a: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >f : (x: T) => U > : ^ ^^ ^^^^^ >x : T @@ -259,9 +259,9 @@ const arrayMap = (f: (x: T) => U) => (a: T[]) => a.map(f); const arrayFilter = (f: (x: T) => boolean) => (a: T[]) => a.filter(f); >arrayFilter : (f: (x: T) => boolean) => (a: T[]) => T[] -> : ^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^ ^^^^^^^^ >(f: (x: T) => boolean) => (a: T[]) => a.filter(f) : (f: (x: T) => boolean) => (a: T[]) => T[] -> : ^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^ ^^^^^^^^ >f : (x: T) => boolean > : ^ ^^ ^^^^^ >x : T @@ -289,7 +289,7 @@ const f20: (a: string[]) => number[] = arrayMap(x => x.length); >arrayMap(x => x.length) : (a: string[]) => number[] > : ^ ^^^^^^^^^^^^^^^^^^^^^^^ >arrayMap : (f: (x: T) => U) => (a: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >x => x.length : (x: string) => number > : ^ ^^^^^^^^^^^^^^^^^^^ >x : string @@ -309,7 +309,7 @@ const f21: (a: A[]) => A[][] = arrayMap(x => [x]); >arrayMap(x => [x]) : (a: A[]) => A[][] > : ^ ^^^^^^^^^^^^^^^ >arrayMap : (f: (x: T) => U) => (a: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >x => [x] : (x: A) => A[] > : ^ ^^^^^^^^^^^ >x : A @@ -327,7 +327,7 @@ const f22: (a: A[]) => A[] = arrayMap(identity); >arrayMap(identity) : (a: A[]) => A[] > : ^ ^^^^^^^^^^^^^ >arrayMap : (f: (x: T) => U) => (a: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >identity : (x: T) => T > : ^ ^^ ^^ ^^^^^ @@ -339,7 +339,7 @@ const f23: (a: A[]) => Box[] = arrayMap(value => ({ value })); >arrayMap(value => ({ value })) : (a: A[]) => { value: A; }[] > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ >arrayMap : (f: (x: T) => U) => (a: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >value => ({ value }) : (value: A) => { value: A; } > : ^ ^^^^^^^^^^^^^^^^^^^^^ >value : A @@ -359,7 +359,7 @@ const f30: (a: string[]) => string[] = arrayFilter(x => x.length > 10); >arrayFilter(x => x.length > 10) : (a: string[]) => string[] > : ^ ^^^^^^^^^^^^^^^^^^^^^^^ >arrayFilter : (f: (x: T) => boolean) => (a: T[]) => T[] -> : ^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^ ^^^^^^^^ >x => x.length > 10 : (x: string) => boolean > : ^ ^^^^^^^^^^^^^^^^^^^^ >x : string @@ -383,7 +383,7 @@ const f31: >(a: T[]) => T[] = arrayFilter(x => x.value > 1 >arrayFilter(x => x.value > 10) : (a: T[]) => T[] > : ^ ^^^^^^^^^^^^^ >arrayFilter : (f: (x: T) => boolean) => (a: T[]) => T[] -> : ^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^ ^^^^^^^^ >x => x.value > 10 : (x: T) => boolean > : ^ ^^^^^^^^^^^^^^^ >x : T diff --git a/tests/baselines/reference/genericFunctionInference1.types b/tests/baselines/reference/genericFunctionInference1.types index e973ef58a7d..7275fd51f97 100644 --- a/tests/baselines/reference/genericFunctionInference1.types +++ b/tests/baselines/reference/genericFunctionInference1.types @@ -874,7 +874,7 @@ declare class Bag { function asFunction(cf: new (...args: A) => B) { >asFunction : (cf: new (...args: A) => B) => (...args: A) => B -> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >cf : new (...args: A) => B > : ^^^^^^^^ ^^ ^^^^^ >args : A @@ -901,7 +901,7 @@ const newPoint = asFunction(Point); >asFunction(Point) : (x: number, y: number) => Point > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >asFunction : (cf: new (...args: A) => B) => (...args: A) => B -> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >Point : typeof Point > : ^^^^^^^^^^^^ @@ -911,7 +911,7 @@ const newBag = asFunction(Bag); >asFunction(Bag) : (...args: T[]) => Bag > : ^ ^^^^^ ^^^^^^^^^^^^^^^^ >asFunction : (cf: new (...args: A) => B) => (...args: A) => B -> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >Bag : typeof Bag > : ^^^^^^^^^^ @@ -1197,9 +1197,9 @@ var actual = flip(zip); const map = (transform: (t: T) => U) => >map : (transform: (t: T) => U) => (arr: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >(transform: (t: T) => U) => (arr: T[]) => arr.map(transform) : (transform: (t: T) => U) => (arr: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >transform : (t: T) => U > : ^ ^^ ^^^^^ >t : T @@ -1239,7 +1239,7 @@ const arr: string[] = map(identityStr)(['a']); >map(identityStr) : (arr: string[]) => string[] > : ^ ^^^^^^^^^^^^^^^^^^^^^^^ >map : (transform: (t: T) => U) => (arr: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >identityStr : (t: string) => string > : ^ ^^ ^^^^^^^^^^^ >['a'] : string[] @@ -1255,7 +1255,7 @@ const arr1: string[] = map(identity)(['a']); >map(identity) : (arr: T[]) => T[] > : ^ ^^ ^^^^^^^^^^^^^ >map : (transform: (t: T) => U) => (arr: T[]) => U[] -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^ >identity : (value: T) => T > : ^ ^^ ^^ ^^^^^ >['a'] : string[] diff --git a/tests/baselines/reference/genericRestParameters1.types b/tests/baselines/reference/genericRestParameters1.types index 12a2957921f..4c181e295a9 100644 --- a/tests/baselines/reference/genericRestParameters1.types +++ b/tests/baselines/reference/genericRestParameters1.types @@ -867,7 +867,7 @@ let x32 = callr(sn, f16); // string | number function bind(f: (x: T, ...rest: U) => V, x: T) { >bind : (f: (x: T, ...rest: U) => V, x: T) => (...rest: U) => V -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >f : (x: T, ...rest: U) => V > : ^ ^^ ^^^^^ ^^ ^^^^^ >x : T @@ -910,7 +910,7 @@ const f21 = bind(f20, 42); // (y: string, z: boolean) => string[] >bind(f20, 42) : (y: string, z: boolean) => string[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >bind : (f: (x: T, ...rest: U) => V, x: T) => (...rest: U) => V -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >f20 : (x: number, y: string, z: boolean) => string[] > : ^ ^^ ^^ ^^ ^^ ^^ ^^^^^ >42 : 42 @@ -922,7 +922,7 @@ const f22 = bind(f21, "hello"); // (z: boolean) => string[] >bind(f21, "hello") : (z: boolean) => string[] > : ^^^^^^^^^^^^^^^^^^^^^^^^ >bind : (f: (x: T, ...rest: U) => V, x: T) => (...rest: U) => V -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >f21 : (y: string, z: boolean) => string[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"hello" : "hello" @@ -934,7 +934,7 @@ const f23 = bind(f22, true); // () => string[] >bind(f22, true) : () => string[] > : ^^^^^^^^^^^^^^ >bind : (f: (x: T, ...rest: U) => V, x: T) => (...rest: U) => V -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >f22 : (z: boolean) => string[] > : ^^^^^^^^^^^^^^^^^^^^^^^^ >true : true @@ -992,7 +992,7 @@ const g21 = bind(g20, 42); // (y: string, z: boolean) => string[] >bind(g20, 42) : (y?: string | undefined, z?: boolean | undefined) => string[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >bind : (f: (x: T, ...rest: U) => V, x: T) => (...rest: U) => V -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >g20 : (x: number, y?: string, z?: boolean) => string[] > : ^ ^^ ^^ ^^^ ^^ ^^^ ^^^^^ >42 : 42 @@ -1004,7 +1004,7 @@ const g22 = bind(g21, "hello"); // (z: boolean) => string[] >bind(g21, "hello") : (z?: boolean | undefined) => string[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >bind : (f: (x: T, ...rest: U) => V, x: T) => (...rest: U) => V -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >g21 : (y?: string | undefined, z?: boolean | undefined) => string[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >"hello" : "hello" @@ -1016,7 +1016,7 @@ const g23 = bind(g22, true); // () => string[] >bind(g22, true) : () => string[] > : ^^^^^^^^^^^^^^ >bind : (f: (x: T, ...rest: U) => V, x: T) => (...rest: U) => V -> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^ >g22 : (z?: boolean | undefined) => string[] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >true : true diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.types b/tests/baselines/reference/genericTypeParameterEquivalence2.types index 3f77e182574..982fdc6970d 100644 --- a/tests/baselines/reference/genericTypeParameterEquivalence2.types +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.types @@ -178,7 +178,7 @@ function curry1(f: (a: A, b: B) => C): (ax: A) => (bx: B) => C { return function (ay: A) { >function (ay: A) { return function (by: B) { return f(ay, by); }; } : (ay: A) => (by: B) => C -> : ^ ^^ ^^^^^^ ^^ ^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^ >ay : A > : ^ diff --git a/tests/baselines/reference/inferTypePredicates.js b/tests/baselines/reference/inferTypePredicates.js index b5802c0e50a..315652eec06 100644 --- a/tests/baselines/reference/inferTypePredicates.js +++ b/tests/baselines/reference/inferTypePredicates.js @@ -616,8 +616,8 @@ declare function assertAndPredicate(x: string | number | Date): x is string; declare let snd: string | number | Date; declare function isNumberWithThis(this: Date, x: number | string): x is number; declare function narrowFromAny(x: any): x is number; -declare const noInferenceFromRest: (f_0: "a" | "b") => boolean; -declare const noInferenceFromImpossibleRest: () => boolean; +declare const noInferenceFromRest: (...f: ["a" | "b"]) => boolean; +declare const noInferenceFromImpossibleRest: (...f: []) => boolean; declare function inferWithRest(x: string | null, ...f: ["a", "b"]): x is string; declare const foobar: { type: "foo"; diff --git a/tests/baselines/reference/inferTypes1.types b/tests/baselines/reference/inferTypes1.types index edc97a2ea14..33d5e8d331d 100644 --- a/tests/baselines/reference/inferTypes1.types +++ b/tests/baselines/reference/inferTypes1.types @@ -657,7 +657,7 @@ type Test2 = EnsureIsString<42>; // never function invoker (key: K, ...args: A) { >invoker : (key: K, ...args: A) => any>>(obj: T) => ReturnType -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^ ^^^^^ >key : K > : ^ >args : A @@ -692,7 +692,7 @@ const result = invoker('test', true)({ test: (a: boolean) => 123 }) >invoker('test', true) : any>>(obj: T) => ReturnType > : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >invoker : (key: K, ...args: A) => any>>(obj: T) => ReturnType -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^ ^^^^^ >'test' : "test" > : ^^^^^^ >true : true diff --git a/tests/baselines/reference/instantiationExpressionErrorNoCrash.types b/tests/baselines/reference/instantiationExpressionErrorNoCrash.types index b32eaab9847..479e3ec1c6e 100644 --- a/tests/baselines/reference/instantiationExpressionErrorNoCrash.types +++ b/tests/baselines/reference/instantiationExpressionErrorNoCrash.types @@ -3,9 +3,9 @@ === instantiationExpressionErrorNoCrash.ts === const createCacheReducer = ( >createCacheReducer : (queries: Cache["queries"]) => (state?: { queries: QR; }) => { queries: QR; } -> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >( queries: Cache["queries"],) => { const queriesMap = {} as QR; const initialState = { queries: queriesMap, }; return (state = initialState) => state;} : (queries: Cache["queries"]) => (state?: { queries: QR; }) => { queries: QR; } -> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ queries: Cache["queries"], >queries : { [QK in keyof QR]: any; } @@ -56,7 +56,7 @@ export type Cache = { [QK in keyof QR]: ReturnType>; >createCacheReducer : (queries: Cache["queries"]) => (state?: { queries: QR_1; }) => { queries: QR_1; } -> : ^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^ ^^^^^^^^ ^^ ^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ }; }; diff --git a/tests/baselines/reference/intersectionTypeInference1.types b/tests/baselines/reference/intersectionTypeInference1.types index 63f9439e7f2..5dea88354b0 100644 --- a/tests/baselines/reference/intersectionTypeInference1.types +++ b/tests/baselines/reference/intersectionTypeInference1.types @@ -31,9 +31,9 @@ const parameterFn = (props:{store:string}) => alert(props.store) const brokenFunction = (f: (p: {dispatch: number} & OwnProps) => void) => (o: OwnProps) => o >brokenFunction : (f: (p: { dispatch: number; } & OwnProps) => void) => (o: OwnProps) => OwnProps -> : ^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^^ >(f: (p: {dispatch: number} & OwnProps) => void) => (o: OwnProps) => o : (f: (p: { dispatch: number; } & OwnProps) => void) => (o: OwnProps) => OwnProps -> : ^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^^ >f : (p: { dispatch: number; } & OwnProps) => void > : ^ ^^ ^^^^^ >p : { dispatch: number; } & OwnProps @@ -55,7 +55,7 @@ export const Form3 = brokenFunction(parameterFn)({store: "hello"}) >brokenFunction(parameterFn) : (o: { store: string; }) => { store: string; } > : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^ >brokenFunction : (f: (p: { dispatch: number; } & OwnProps) => void) => (o: OwnProps) => OwnProps -> : ^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^^ >parameterFn : (props: { store: string; }) => void > : ^ ^^ ^^^^^^^^^ >{store: "hello"} : { store: string; } diff --git a/tests/baselines/reference/intraExpressionInferences.types b/tests/baselines/reference/intraExpressionInferences.types index 7078c2603be..37c49da2a03 100644 --- a/tests/baselines/reference/intraExpressionInferences.types +++ b/tests/baselines/reference/intraExpressionInferences.types @@ -817,7 +817,7 @@ interface Opts { function example(options: Opts) { >example : (options: Opts) => (params: TParams) => TMapped -> : ^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^ >options : Opts > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -871,7 +871,7 @@ example({ >example({ fetch: (params: Params) => 123, map: (number) => String(number)}) : (params: Params) => string > : ^ ^^^^^^^^^^^^^^^^^^^ >example : (options: Opts) => (params: TParams) => TMapped -> : ^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^ >{ fetch: (params: Params) => 123, map: (number) => String(number)} : { fetch: (params: Params) => number; map: (number: number) => string; } > : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ @@ -905,7 +905,7 @@ example({ >example({ fetch: (params: Params, foo: number) => 123, map: (number) => String(number)}) : (params: Params) => string > : ^ ^^^^^^^^^^^^^^^^^^^ >example : (options: Opts) => (params: TParams) => TMapped -> : ^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^ >{ fetch: (params: Params, foo: number) => 123, map: (number) => String(number)} : { fetch: (params: Params, foo: number) => number; map: (number: number) => string; } > : ^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ @@ -941,7 +941,7 @@ example({ >example({ fetch: (params: Params, foo) => 123, map: (number) => String(number)}) : (params: Params) => string > : ^ ^^^^^^^^^^^^^^^^^^^ >example : (options: Opts) => (params: TParams) => TMapped -> : ^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^ >{ fetch: (params: Params, foo) => 123, map: (number) => String(number)} : { fetch: (params: Params, foo: number) => number; map: (number: number) => string; } > : ^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/isolatedDeclarationsAddUndefined.types b/tests/baselines/reference/isolatedDeclarationsAddUndefined.types index 8c2ef0242be..40db4115589 100644 --- a/tests/baselines/reference/isolatedDeclarationsAddUndefined.types +++ b/tests/baselines/reference/isolatedDeclarationsAddUndefined.types @@ -45,7 +45,7 @@ export class Bar { === file2.ts === export function foo(p = (ip = 10, v: number): void => {}): void{ >foo : (p?: (ip: number | undefined, v: number) => void) => void -> : ^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^^^^ +> : ^ ^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^ ^^^^^ >p : (ip: number | undefined, v: number) => void > : ^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^ >(ip = 10, v: number): void => {} : (ip: number | undefined, v: number) => void @@ -63,7 +63,7 @@ type T = number export function foo2(p = (ip = 10 as T, v: number): void => {}): void{} >foo2 : (p?: (ip: T | undefined, v: number) => void) => void -> : ^ ^^^^ ^^ ^^^^^^^^^^^^^^ ^^ ^^^^^ ^^^^^ +> : ^ ^^^^ ^^^^^^^^^^^^^^ ^^^^^ ^^^^^ >p : (ip: T | undefined, v: number) => void > : ^ ^^ ^^^^^^^^^^^^^^ ^^ ^^^^^ >(ip = 10 as T, v: number): void => {} : (ip: T | undefined, v: number) => void diff --git a/tests/baselines/reference/jsdocSignatureOnReturnedFunction.types b/tests/baselines/reference/jsdocSignatureOnReturnedFunction.types index df1f4789406..c6031140854 100644 --- a/tests/baselines/reference/jsdocSignatureOnReturnedFunction.types +++ b/tests/baselines/reference/jsdocSignatureOnReturnedFunction.types @@ -3,7 +3,7 @@ === jsdocSignatureOnReturnedFunction.js === function f1() { >f1 : () => (a: number, b: number) => number -> : ^^^^^^^ ^^ ^^ ^^ ^^^^^ +> : ^^^^^^^ ^^ ^^^^^ /** * @param {number} a @@ -30,7 +30,7 @@ function f1() { function f2() { >f2 : () => (a: number, b: number) => number -> : ^^^^^^^ ^^ ^^ ^^ ^^^^^ +> : ^^^^^^^ ^^ ^^^^^ /** * @param {number} a diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index b2a18156304..33fafc02e83 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -2429,9 +2429,9 @@ function f1(thing: Thing) { const assignTo2 = (object: T, key1: K1, key2: K2) => >assignTo2 : (object: T, key1: K1, key2: K2) => (value: T[K1][K2]) => T[K1][K2] -> : ^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ >(object: T, key1: K1, key2: K2) => (value: T[K1][K2]) => object[key1][key2] = value : (object: T, key1: K1, key2: K2) => (value: T[K1][K2]) => T[K1][K2] -> : ^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ >object : T > : ^ >key1 : K1 diff --git a/tests/baselines/reference/narrowingPastLastAssignment.types b/tests/baselines/reference/narrowingPastLastAssignment.types index 6b6ea09ba96..f2c62a10d13 100644 --- a/tests/baselines/reference/narrowingPastLastAssignment.types +++ b/tests/baselines/reference/narrowingPastLastAssignment.types @@ -567,7 +567,7 @@ namespace Foo { function f10() { >f10 : () => (k: number) => boolean -> : ^^^^^^^ ^^ ^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ let i: number | undefined; >i : number | undefined @@ -600,7 +600,7 @@ function f10() { function makeAdder(n?: number) { >makeAdder : (n?: number) => (m: number) => number -> : ^ ^^^ ^^^^^^ ^^ ^^^^^^^^^^^ +> : ^ ^^^ ^^^^^^ ^^^^^^^^^^^ >n : number | undefined > : ^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/nestedRecursiveLambda.types b/tests/baselines/reference/nestedRecursiveLambda.types index 097b3ce0cba..7e99adf7f4c 100644 --- a/tests/baselines/reference/nestedRecursiveLambda.types +++ b/tests/baselines/reference/nestedRecursiveLambda.types @@ -10,9 +10,9 @@ void (r =>(r => r)); >void (r =>(r => r)) : undefined > : ^^^^^^^^^ >(r =>(r => r)) : (r: any) => (r: any) => any -> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^ >r =>(r => r) : (r: any) => (r: any) => any -> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^ >r : any >(r => r) : (r: any) => any > : ^ ^^^^^^^^^^^^^ @@ -42,9 +42,9 @@ void(r =>(r => r)); >void(r =>(r => r)) : undefined > : ^^^^^^^^^ >(r =>(r => r)) : (r: any) => (r: any) => any -> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^ >r =>(r => r) : (r: any) => (r: any) => any -> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^ >r : any >(r => r) : (r: any) => any > : ^ ^^^^^^^^^^^^^ @@ -55,11 +55,11 @@ void(r =>(r => r)); [(r =>(r => r))] >[(r =>(r => r))] : ((r: any) => (r: any) => any)[] -> : ^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ +> : ^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^ >(r =>(r => r)) : (r: any) => (r: any) => any -> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^ >r =>(r => r) : (r: any) => (r: any) => any -> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^ >r : any >(r => r) : (r: any) => any > : ^ ^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/parameterInitializersForwardReferencing1.types b/tests/baselines/reference/parameterInitializersForwardReferencing1.types index 48f7f07c1ca..f18d9ae0f49 100644 --- a/tests/baselines/reference/parameterInitializersForwardReferencing1.types +++ b/tests/baselines/reference/parameterInitializersForwardReferencing1.types @@ -28,7 +28,7 @@ function f1 (bar = foo) { // unexpected compiler error; works at runtime function f2 (bar = (baz = foo) => baz) { // unexpected compiler error; works at runtime >f2 : (bar?: (baz?: number) => number) => number -> : ^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >bar : (baz?: number) => number > : ^ ^^^^^^^^^^^^^^^^^^^^ >(baz = foo) => baz : (baz?: number) => number diff --git a/tests/baselines/reference/parameterInitializersForwardReferencing1_es6.types b/tests/baselines/reference/parameterInitializersForwardReferencing1_es6.types index 5ec0f47f3c7..6f755605b1f 100644 --- a/tests/baselines/reference/parameterInitializersForwardReferencing1_es6.types +++ b/tests/baselines/reference/parameterInitializersForwardReferencing1_es6.types @@ -28,7 +28,7 @@ function f1 (bar = foo) { // unexpected compiler error; works at runtime function f2 (bar = (baz = foo) => baz) { // unexpected compiler error; works at runtime >f2 : (bar?: (baz?: string) => string) => string -> : ^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >bar : (baz?: string) => string > : ^ ^^^^^^^^^^^^^^^^^^^^ >(baz = foo) => baz : (baz?: string) => string diff --git a/tests/baselines/reference/parameterReferenceInInitializer2.types b/tests/baselines/reference/parameterReferenceInInitializer2.types index 91a8db5fb41..24a36124830 100644 --- a/tests/baselines/reference/parameterReferenceInInitializer2.types +++ b/tests/baselines/reference/parameterReferenceInInitializer2.types @@ -3,7 +3,7 @@ === parameterReferenceInInitializer2.ts === function Example(x = function(x: any) { return x; }) { // Error: parameter 'x' cannot be >Example : (x?: (x: any) => any) => void -> : ^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^ +> : ^ ^^^^ ^^^^^^^^^^^^^^^^^ >x : (x: any) => any > : ^ ^^ ^^^^^^^^ >function(x: any) { return x; } : (x: any) => any diff --git a/tests/baselines/reference/parseErrorIncorrectReturnToken.types b/tests/baselines/reference/parseErrorIncorrectReturnToken.types index 1ded003a8f9..10f02608b06 100644 --- a/tests/baselines/reference/parseErrorIncorrectReturnToken.types +++ b/tests/baselines/reference/parseErrorIncorrectReturnToken.types @@ -20,9 +20,9 @@ type F2 = (n: number): string; // should be => not : // doesn't work in non-type contexts, where the return type is optional let f = (n: number) => string => n.toString(); >f : (n: number) => (string: any) => string -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ >(n: number) => string => n.toString() : (n: number) => (string: any) => string -> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^^^^^^ >n : number > : ^^^^^^ >string => n.toString() : (string: any) => string diff --git a/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.types b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.types index 974be160ca6..486c717c81c 100644 --- a/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.types +++ b/tests/baselines/reference/reactReduxLikeDeferredInferenceAllowsAssignment.types @@ -280,9 +280,9 @@ const simpleAction = (payload: boolean) => ({ }); const thunkAction = (param1: number, param2: string) => async ( >thunkAction : (param1: number, param2: string) => (dispatch: Dispatch, { foo }: OwnProps) => Promise -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ >(param1: number, param2: string) => async ( dispatch: Dispatch, { foo }: OwnProps) => { return foo;} : (param1: number, param2: string) => (dispatch: Dispatch, { foo }: OwnProps) => Promise -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ >param1 : number > : ^^^^^^ >param2 : string @@ -332,13 +332,13 @@ class TestComponent extends Component {} const mapDispatchToProps = { simpleAction, thunkAction }; >mapDispatchToProps : { simpleAction: (payload: boolean) => { type: string; payload: boolean; }; thunkAction: (param1: number, param2: string) => (dispatch: Dispatch, { foo }: OwnProps) => Promise; } -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^ >{ simpleAction, thunkAction } : { simpleAction: (payload: boolean) => { type: string; payload: boolean; }; thunkAction: (param1: number, param2: string) => (dispatch: Dispatch, { foo }: OwnProps) => Promise; } -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^ >simpleAction : (payload: boolean) => { type: string; payload: boolean; } > : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >thunkAction : (param1: number, param2: string) => (dispatch: Dispatch, { foo }: OwnProps) => Promise -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ type Q = HandleThunkActionCreator; >Q : (payload: boolean) => { type: string; payload: boolean; } @@ -359,7 +359,7 @@ const Test1 = connect( null, mapDispatchToProps >mapDispatchToProps : { simpleAction: (payload: boolean) => { type: string; payload: boolean; }; thunkAction: (param1: number, param2: string) => (dispatch: Dispatch, { foo }: OwnProps) => Promise; } -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^ +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^ )(TestComponent); >TestComponent : typeof TestComponent diff --git a/tests/baselines/reference/returnStatement1.types b/tests/baselines/reference/returnStatement1.types index 8759bb1025a..6aa617fcbff 100644 --- a/tests/baselines/reference/returnStatement1.types +++ b/tests/baselines/reference/returnStatement1.types @@ -3,7 +3,7 @@ === returnStatement1.ts === function f() { >f : () => (s: any) => void -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return function (s) { >function (s) { var x = s; } : (s: any) => void diff --git a/tests/baselines/reference/reverseMappedTypeIntersectionConstraint.types b/tests/baselines/reference/reverseMappedTypeIntersectionConstraint.types index 656259e8eb9..e68b26d70e4 100644 --- a/tests/baselines/reference/reverseMappedTypeIntersectionConstraint.types +++ b/tests/baselines/reference/reverseMappedTypeIntersectionConstraint.types @@ -128,9 +128,9 @@ const inferredParams2 = createMachine({ const checkType = () => (value: { [K in keyof U & keyof T]: U[K] }) => value; >checkType : () => (value: { [K in keyof U & keyof T]: U[K]; }) => { [K in keyof U & keyof T]: U[K]; } -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >() => (value: { [K in keyof U & keyof T]: U[K] }) => value : () => (value: { [K in keyof U & keyof T]: U[K]; }) => { [K in keyof U & keyof T]: U[K]; } -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >(value: { [K in keyof U & keyof T]: U[K] }) => value : (value: { [K in keyof U & keyof T]: U[K]; }) => { [K in keyof U & keyof T]: U[K]; } > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : { [K in keyof U & keyof T]: U[K]; } @@ -146,7 +146,7 @@ const checked = checkType<{x: number, y: string}>()({ >checkType<{x: number, y: string}>() : (value: { [K in keyof U & ("x" | "y")]: U[K]; }) => { [K in keyof U & ("x" | "y")]: U[K]; } > : ^ ^^^^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >checkType : () => (value: { [K in keyof U & keyof T]: U[K]; }) => { [K in keyof U & keyof T]: U[K]; } -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ >y : string diff --git a/tests/baselines/reference/reverseMappedTypeLimitedConstraint.types b/tests/baselines/reference/reverseMappedTypeLimitedConstraint.types index 62a5ce588c9..647b34f87f3 100644 --- a/tests/baselines/reference/reverseMappedTypeLimitedConstraint.types +++ b/tests/baselines/reference/reverseMappedTypeLimitedConstraint.types @@ -33,9 +33,9 @@ foo_({x: 1, y: 'foo'}); const checkType_ = () => (value: { [K in keyof U & keyof T]: U[K] }) => value; >checkType_ : () => (value: { [K in keyof U & keyof T]: U[K]; }) => { [K in keyof U & keyof T]: U[K]; } -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >() => (value: { [K in keyof U & keyof T]: U[K] }) => value : () => (value: { [K in keyof U & keyof T]: U[K]; }) => { [K in keyof U & keyof T]: U[K]; } -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >(value: { [K in keyof U & keyof T]: U[K] }) => value : (value: { [K in keyof U & keyof T]: U[K]; }) => { [K in keyof U & keyof T]: U[K]; } > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >value : { [K in keyof U & keyof T]: U[K]; } @@ -51,7 +51,7 @@ const checked_ = checkType_<{x: number, y: string}>()({ >checkType_<{x: number, y: string}>() : (value: { [K in keyof U & ("x" | "y")]: U[K]; }) => { [K in keyof U & ("x" | "y")]: U[K]; } > : ^ ^^^^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >checkType_ : () => (value: { [K in keyof U & keyof T]: U[K]; }) => { [K in keyof U & keyof T]: U[K]; } -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ >y : string diff --git a/tests/baselines/reference/spreadParameterTupleType.js b/tests/baselines/reference/spreadParameterTupleType.js index 3d28fd97643..bd1e2a32454 100644 --- a/tests/baselines/reference/spreadParameterTupleType.js +++ b/tests/baselines/reference/spreadParameterTupleType.js @@ -5,7 +5,7 @@ function f1() { type A = [s: string]; type C = [...A, ...A]; - return function fn(...args: C) { } + return function fn(...args: C) { } satisfies any } function f2() { @@ -14,7 +14,7 @@ function f2() { type C = [c: string]; type D = [...A, ...A, ...B, ...A, ...B, ...B, ...A, ...C]; - return function fn(...args: D) { } + return function fn(...args: D) { } satisfies any; } diff --git a/tests/baselines/reference/spreadParameterTupleType.symbols b/tests/baselines/reference/spreadParameterTupleType.symbols index 7ff72e7a3dc..c966f3c166d 100644 --- a/tests/baselines/reference/spreadParameterTupleType.symbols +++ b/tests/baselines/reference/spreadParameterTupleType.symbols @@ -12,7 +12,7 @@ function f1() { >A : Symbol(A, Decl(spreadParameterTupleType.ts, 0, 15)) >A : Symbol(A, Decl(spreadParameterTupleType.ts, 0, 15)) - return function fn(...args: C) { } + return function fn(...args: C) { } satisfies any >fn : Symbol(fn, Decl(spreadParameterTupleType.ts, 4, 10)) >args : Symbol(args, Decl(spreadParameterTupleType.ts, 4, 23)) >C : Symbol(C, Decl(spreadParameterTupleType.ts, 1, 25)) @@ -41,7 +41,7 @@ function f2() { >A : Symbol(A, Decl(spreadParameterTupleType.ts, 7, 15)) >C : Symbol(C, Decl(spreadParameterTupleType.ts, 9, 25)) - return function fn(...args: D) { } + return function fn(...args: D) { } satisfies any; >fn : Symbol(fn, Decl(spreadParameterTupleType.ts, 13, 10)) >args : Symbol(args, Decl(spreadParameterTupleType.ts, 13, 23)) >D : Symbol(D, Decl(spreadParameterTupleType.ts, 10, 25)) diff --git a/tests/baselines/reference/spreadParameterTupleType.types b/tests/baselines/reference/spreadParameterTupleType.types index 99d8f1da4fa..f4f0291a175 100644 --- a/tests/baselines/reference/spreadParameterTupleType.types +++ b/tests/baselines/reference/spreadParameterTupleType.types @@ -13,7 +13,9 @@ function f1() { >C : [s: string, s: string] > : ^^^^^^^^^^^^^^^^^^^^^^ - return function fn(...args: C) { } + return function fn(...args: C) { } satisfies any +>function fn(...args: C) { } satisfies any : (s: string, s_1: string) => void +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >function fn(...args: C) { } : (s: string, s_1: string) => void > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >fn : (s: string, s_1: string) => void @@ -42,7 +44,9 @@ function f2() { >D : [a: string, a: string, b: string, a: string, b: string, b: string, a: string, c: string] > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - return function fn(...args: D) { } + return function fn(...args: D) { } satisfies any; +>function fn(...args: D) { } satisfies any : (a: string, a_1: string, b: string, a_2: string, b_1: string, b_2: string, a_3: string, c: string) => void +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >function fn(...args: D) { } : (a: string, a_1: string, b: string, a_2: string, b_1: string, b_2: string, a_3: string, c: string) => void > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >fn : (a: string, a_1: string, b: string, a_2: string, b_1: string, b_2: string, a_3: string, c: string) => void diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.types b/tests/baselines/reference/subtypingWithCallSignatures2.types index 092c2c532d2..f27c17e862f 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.types +++ b/tests/baselines/reference/subtypingWithCallSignatures2.types @@ -719,9 +719,9 @@ var r6b = [r6arg2, r6arg1]; var r7arg1 = (x: (arg: T) => U) => (r: T) => null; >r7arg1 : (x: (arg: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ >(x: (arg: T) => U) => (r: T) => null : (x: (arg: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ >x : (arg: T) => U > : ^ ^^ ^^^^^ >arg : T @@ -735,9 +735,9 @@ var r7arg1 = (x: (arg: T) => U) => (r: T) => var r7arg2 = (x: (arg: Base) => Derived) => (r: Base) => null; >r7arg2 : (x: (arg: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^ >(x: (arg: Base) => Derived) => (r: Base) => null : (x: (arg: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^ >x : (arg: Base) => Derived > : ^ ^^ ^^^^^ >arg : Base @@ -757,33 +757,33 @@ var r7 = foo7(r7arg1); // any >foo7 : { (a: (x: (arg: Base) => Derived) => (r: Base) => Derived): typeof a; (a: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r7arg1 : (x: (arg: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ var r7a = [r7arg1, r7arg2]; >r7a : ((x: (arg: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^^^^^ ^^^^^ ^^^ >[r7arg1, r7arg2] : ((x: (arg: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^^^^^ ^^^^^ ^^^ >r7arg1 : (x: (arg: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ >r7arg2 : (x: (arg: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^ var r7b = [r7arg2, r7arg1]; >r7b : ((x: (arg: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^^^^^ ^^^^^ ^^^ >[r7arg2, r7arg1] : ((x: (arg: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^^^^^ ^^^^^ ^^^ >r7arg2 : (x: (arg: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^ >r7arg1 : (x: (arg: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ var r8arg1 = (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => null; >r8arg1 : (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => null : (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >x : (arg: T) => U > : ^ ^^ ^^^^^ >arg : T @@ -801,9 +801,9 @@ var r8arg1 = (x: (arg: T) => U, y: (arg2: T) var r8arg2 = (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => null; >r8arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => null : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >x : (arg: Base) => Derived > : ^ ^^ ^^^^^ >arg : Base @@ -827,33 +827,33 @@ var r8 = foo8(r8arg1); // any >foo8 : { (a: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a; (a: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r8arg1 : (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ var r8a = [r8arg1, r8arg2]; >r8a : ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^ >[r8arg1, r8arg2] : ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^ >r8arg1 : (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >r8arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ var r8b = [r8arg2, r8arg1]; >r8b : ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^ >[r8arg2, r8arg1] : ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^ >r8arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >r8arg1 : (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ var r9arg1 = (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => null; >r9arg1 : (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => null : (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >x : (arg: T) => U > : ^ ^^ ^^^^^ >arg : T @@ -875,9 +875,9 @@ var r9arg1 = (x: (arg: T) => U, y: (arg2: { f var r9arg2 = (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => null; >r9arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => null : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >x : (arg: Base) => Derived > : ^ ^^ ^^^^^ >arg : Base @@ -901,27 +901,27 @@ var r9 = foo9(r9arg1); // any >foo9 : { (a: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a; (a: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r9arg1 : (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ var r9a = [r9arg1, r9arg2]; >r9a : ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^ >[r9arg1, r9arg2] : ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^ >r9arg1 : (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >r9arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ var r9b = [r9arg2, r9arg1]; >r9b : ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^ >[r9arg2, r9arg1] : ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived)[] -> : ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^ >r9arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >r9arg1 : (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ var r10arg1 = (...x: T[]) => x[0]; >r10arg1 : (...x: T[]) => T diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.types b/tests/baselines/reference/subtypingWithCallSignatures3.types index 8e5ad846401..5618553cd89 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.types +++ b/tests/baselines/reference/subtypingWithCallSignatures3.types @@ -308,9 +308,9 @@ module Errors { var r2arg = (x: (arg: T) => U) => (r: T) => null; >r2arg : (x: (arg: T) => U) => (r: T) => V -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ >(x: (arg: T) => U) => (r: T) => null : (x: (arg: T) => U) => (r: T) => V -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ >x : (arg: T) => U > : ^ ^^ ^^^^^ >arg : T @@ -324,9 +324,9 @@ module Errors { var r2arg2 = (x: (arg: Base) => Derived) => (r: Base) => null; >r2arg2 : (x: (arg: Base) => Derived) => (r: Base) => Derived2 -> : ^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^ >(x: (arg: Base) => Derived) => (r: Base) => null : (x: (arg: Base) => Derived) => (r: Base) => Derived2 -> : ^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^ >x : (arg: Base) => Derived > : ^ ^^ ^^^^^ >arg : Base @@ -346,33 +346,33 @@ module Errors { >foo7 : { (a2: (x: (arg: Base) => Derived) => (r: Base) => Derived2): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r2arg : (x: (arg: T) => U) => (r: T) => V -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ var r2a = [r2arg2, r2arg]; >r2a : ((x: (arg: Base) => Derived) => (r: Base) => Derived2)[] -> : ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^^^^^ ^^^^^ ^^^ >[r2arg2, r2arg] : ((x: (arg: Base) => Derived) => (r: Base) => Derived2)[] -> : ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^^^^^ ^^^^^ ^^^ >r2arg2 : (x: (arg: Base) => Derived) => (r: Base) => Derived2 -> : ^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^ >r2arg : (x: (arg: T) => U) => (r: T) => V -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ var r2b = [r2arg, r2arg2]; >r2b : ((x: (arg: Base) => Derived) => (r: Base) => Derived2)[] -> : ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^^^^^ ^^^^^ ^^^ >[r2arg, r2arg2] : ((x: (arg: Base) => Derived) => (r: Base) => Derived2)[] -> : ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^ +> : ^^ ^^ ^^^^^^ ^^^^^ ^^^ >r2arg : (x: (arg: T) => U) => (r: T) => V -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ >r2arg2 : (x: (arg: Base) => Derived) => (r: Base) => Derived2 -> : ^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^ var r3arg = (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => null; >r3arg : (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => null : (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >x : (arg: T) => U > : ^ ^^ ^^^^^ >arg : T @@ -392,9 +392,9 @@ module Errors { var r3arg2 = (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => null; >r3arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => null : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >x : (arg: Base) => Derived > : ^ ^^ ^^^^^ >arg : Base @@ -416,27 +416,27 @@ module Errors { >foo8 : { (a2: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived): typeof a2; (a2: any): any; } > : ^^^ ^^ ^^^ ^^^ ^^ ^^^ ^^^ >r3arg : (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ var r3a = [r3arg2, r3arg]; >r3a : (((x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[] -> : ^^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^^ +> : ^^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^^ >[r3arg2, r3arg] : (((x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[] -> : ^^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^^ +> : ^^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^^ >r3arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >r3arg : (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ var r3b = [r3arg, r3arg2]; >r3b : (((x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[] -> : ^^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^^ +> : ^^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^^ >[r3arg, r3arg2] : (((x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[] -> : ^^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ ^^^^ +> : ^^^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^^^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ ^^^^ >r3arg : (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^^ ^^^^^ >r3arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived -> : ^ ^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^ ^^ ^^ ^^^^^^ ^^^^^ var r4arg = (...x: T[]) => null; >r4arg : (...x: T[]) => T diff --git a/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.types b/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.types index b704346279b..91bf8b50792 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.types +++ b/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.types @@ -5,9 +5,9 @@ const f = _ => (..._) => ""; >f : (_: any) => (..._: any[]) => string -> : ^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ >_ => (..._) => "" : (_: any) => (..._: any[]) => string -> : ^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ >_ : any >(..._) => "" : (..._: any[]) => string > : ^^^^ ^^^^^^^^^^^^^^^^^^ @@ -22,7 +22,7 @@ f({ ...{ x: 0 } })``; >f({ ...{ x: 0 } }) : (..._: any[]) => string > : ^^^^ ^^^^^^^^^^^^^^^^^^ >f : (_: any) => (..._: any[]) => string -> : ^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ >{ ...{ x: 0 } } : { x: number; } > : ^^^^^^^^^^^^^^ >{ x: 0 } : { x: number; } @@ -40,7 +40,7 @@ f({ ...{ x: 0 } })`x`; >f({ ...{ x: 0 } }) : (..._: any[]) => string > : ^^^^ ^^^^^^^^^^^^^^^^^^ >f : (_: any) => (..._: any[]) => string -> : ^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ >{ ...{ x: 0 } } : { x: number; } > : ^^^^^^^^^^^^^^ >{ x: 0 } : { x: number; } @@ -58,7 +58,7 @@ f({ ...{ x: 0 } })`x${f}x`; >f({ ...{ x: 0 } }) : (..._: any[]) => string > : ^^^^ ^^^^^^^^^^^^^^^^^^ >f : (_: any) => (..._: any[]) => string -> : ^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ >{ ...{ x: 0 } } : { x: number; } > : ^^^^^^^^^^^^^^ >{ x: 0 } : { x: number; } @@ -70,7 +70,7 @@ f({ ...{ x: 0 } })`x${f}x`; >`x${f}x` : string > : ^^^^^^ >f : (_: any) => (..._: any[]) => string -> : ^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ f({ ...{ x: 0 }, y: (() => 1)() })``; >f({ ...{ x: 0 }, y: (() => 1)() })`` : string @@ -78,7 +78,7 @@ f({ ...{ x: 0 }, y: (() => 1)() })``; >f({ ...{ x: 0 }, y: (() => 1)() }) : (..._: any[]) => string > : ^^^^ ^^^^^^^^^^^^^^^^^^ >f : (_: any) => (..._: any[]) => string -> : ^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ >{ ...{ x: 0 }, y: (() => 1)() } : { y: number; x: number; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^ >{ x: 0 } : { x: number; } @@ -106,7 +106,7 @@ f({ x: (() => 1)(), ...{ y: 1 } })``; >f({ x: (() => 1)(), ...{ y: 1 } }) : (..._: any[]) => string > : ^^^^ ^^^^^^^^^^^^^^^^^^ >f : (_: any) => (..._: any[]) => string -> : ^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ >{ x: (() => 1)(), ...{ y: 1 } } : { y: number; x: number; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^ >x : number diff --git a/tests/baselines/reference/templateLiteralTypes1.types b/tests/baselines/reference/templateLiteralTypes1.types index 499986b2d51..d29f030fcae 100644 --- a/tests/baselines/reference/templateLiteralTypes1.types +++ b/tests/baselines/reference/templateLiteralTypes1.types @@ -9,9 +9,9 @@ Instantiation count: 2,500 const createScopedActionType = (scope: S) => (type: T) => `${scope}/${type}` as `${S}/${T}`; >createScopedActionType : (scope: S) => (type: T) => `${S}/${T}` -> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >(scope: S) => (type: T) => `${scope}/${type}` as `${S}/${T}` : (scope: S) => (type: T) => `${S}/${T}` -> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >scope : S > : ^ >(type: T) => `${scope}/${type}` as `${S}/${T}` : (type: T) => `${S}/${T}` @@ -33,7 +33,7 @@ const createActionInMyScope = createScopedActionType("MyScope"); // createScopedActionType("MyScope") : (type: T) => `MyScope/${T}` > : ^ ^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^ >createScopedActionType : (scope: S) => (type: T) => `${S}/${T}` -> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >"MyScope" : "MyScope" > : ^^^^^^^^^ diff --git a/tests/baselines/reference/thisExpressionInIndexExpression.types b/tests/baselines/reference/thisExpressionInIndexExpression.types index 2dcb728725d..73bdb4d004b 100644 --- a/tests/baselines/reference/thisExpressionInIndexExpression.types +++ b/tests/baselines/reference/thisExpressionInIndexExpression.types @@ -3,7 +3,7 @@ === thisExpressionInIndexExpression.ts === function f() { >f : () => (r: any) => any -> : ^^^^^^^ ^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^ return r => r[this]; >r => r[this] : (r: any) => any diff --git a/tests/baselines/reference/thisTypeInClasses.types b/tests/baselines/reference/thisTypeInClasses.types index 699341a5cf9..fb3f7244275 100644 --- a/tests/baselines/reference/thisTypeInClasses.types +++ b/tests/baselines/reference/thisTypeInClasses.types @@ -132,9 +132,9 @@ class C5 { let f3 = (x: this) => (y: this) => this; >f3 : (x: this) => (y: this) => this -> : ^ ^^ ^^^^^^ ^^ ^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^ >(x: this) => (y: this) => this : (x: this) => (y: this) => this -> : ^ ^^ ^^^^^^ ^^ ^^^^^^^^^ +> : ^ ^^ ^^^^^^ ^^^^^^^^^ >x : this > : ^^^^ >(y: this) => this : (y: this) => this diff --git a/tests/baselines/reference/trackedSymbolsNoCrash.types b/tests/baselines/reference/trackedSymbolsNoCrash.types index 02ee07d283a..0b3a861418b 100644 --- a/tests/baselines/reference/trackedSymbolsNoCrash.types +++ b/tests/baselines/reference/trackedSymbolsNoCrash.types @@ -1019,11 +1019,11 @@ import * as ast from "./ast"; export const isNodeOfType = >isNodeOfType : (nodeType: NodeType) => (node: ast.Node | null | undefined) => node is Extract -> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ (nodeType: NodeType) => >(nodeType: NodeType) => ( node: ast.Node | null | undefined, ): node is Extract => node?.kind === nodeType : (nodeType: NodeType) => (node: ast.Node | null | undefined) => node is Extract -> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^^^^ >ast : any > : ^^^ >nodeType : NodeType diff --git a/tests/baselines/reference/transpile/declarationRestParameters.d.ts b/tests/baselines/reference/transpile/declarationRestParameters.d.ts index 46f2c56b796..eb411b39bc3 100644 --- a/tests/baselines/reference/transpile/declarationRestParameters.d.ts +++ b/tests/baselines/reference/transpile/declarationRestParameters.d.ts @@ -16,62 +16,35 @@ export const v2 = (...a: [n: "n", a: "a"]): { return null! } //// [v1.d.ts] //// -export declare const v1: (n: "n", a: "a") => { +export declare const v1: (...a: [n: "n", a: "a"]) => { /** r rest param */ - a: [n: "n", a: "a"]; + a: typeof a; }; - - -//// [Diagnostics reported] -v1.ts(3,15): error TS9039: Type containing private name 'a' can't be used with --isolatedDeclarations. - - -==== v1.ts (1 errors) ==== - export const v1 = (...a: [n: "n", a: "a"]): { - /** r rest param */ - a: typeof a, - ~ -!!! error TS9039: Type containing private name 'a' can't be used with --isolatedDeclarations. -!!! related TS9027 v1.ts:1:14: Add a type annotation to the variable v1. - } => { - return null! - } - //// [v2.d.ts] //// -export declare const v2: (n: "n", a: "a") => { +declare const n: unique symbol; +export declare const v2: (...a: [n: "n", a: "a"]) => { /** r rest param */ - a: [n: "n", a: "a"]; + a: typeof a; /** module var */ - n: unique symbol; + n: typeof n; }; +export {}; //// [Diagnostics reported] -v2.ts(2,14): error TS2527: The inferred type of 'v2' references an inaccessible 'unique symbol' type. A type annotation is necessary. -v2.ts(4,15): error TS9039: Type containing private name 'a' can't be used with --isolatedDeclarations. -v2.ts(6,5): error TS9013: Expression type can't be inferred with --isolatedDeclarations. -v2.ts(6,15): error TS9039: Type containing private name 'n' can't be used with --isolatedDeclarations. +v2.ts(1,7): error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations. -==== v2.ts (4 errors) ==== +==== v2.ts (1 errors) ==== const n = Symbol(); + ~ +!!! error TS9010: Variable must have an explicit type annotation with --isolatedDeclarations. +!!! related TS9027 v2.ts:1:7: Add a type annotation to the variable n. export const v2 = (...a: [n: "n", a: "a"]): { - ~~ -!!! error TS2527: The inferred type of 'v2' references an inaccessible 'unique symbol' type. A type annotation is necessary. /** r rest param */ a: typeof a, - ~ -!!! error TS9039: Type containing private name 'a' can't be used with --isolatedDeclarations. -!!! related TS9027 v2.ts:2:14: Add a type annotation to the variable v2. /** module var */ n: typeof n, - ~ -!!! error TS9013: Expression type can't be inferred with --isolatedDeclarations. -!!! related TS9027 v2.ts:2:14: Add a type annotation to the variable v2. -!!! related TS9035 v2.ts:6:5: Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit. - ~ -!!! error TS9039: Type containing private name 'n' can't be used with --isolatedDeclarations. -!!! related TS9027 v2.ts:2:14: Add a type annotation to the variable v2. } => { return null! } diff --git a/tests/baselines/reference/typeParameterConstModifiers.types b/tests/baselines/reference/typeParameterConstModifiers.types index 6566a49b751..de77ed9efad 100644 --- a/tests/baselines/reference/typeParameterConstModifiers.types +++ b/tests/baselines/reference/typeParameterConstModifiers.types @@ -727,7 +727,7 @@ const test_55033_minimal = factory_55033_minimal((b: string) => {}) function factory_55033(cb: (...args: T) => void) { >factory_55033 : (cb: (...args: T) => void) => (...args: K) => K -> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^ +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >cb : (...args: T) => void > : ^^^^ ^^ ^^^^^ >args : T @@ -758,7 +758,7 @@ const t1_55033 = factory_55033((a: { test: number }, b: string) => {})( >factory_55033((a: { test: number }, b: string) => {}) : (...args: K) => K > : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ >factory_55033 : (cb: (...args: T) => void) => (...args: K) => K -> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^ +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >(a: { test: number }, b: string) => {} : (a: { test: number; }, b: string) => void > : ^ ^^ ^^ ^^ ^^^^^^^^^ >a : { test: number; } @@ -790,7 +790,7 @@ const t2_55033 = factory_55033((a: { test: number }, b: string) => {})( >factory_55033((a: { test: number }, b: string) => {}) : (...args: K) => K > : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ >factory_55033 : (cb: (...args: T) => void) => (...args: K) => K -> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^ +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >(a: { test: number }, b: string) => {} : (a: { test: number; }, b: string) => void > : ^ ^^ ^^ ^^ ^^^^^^^^^ >a : { test: number; } @@ -820,7 +820,7 @@ const t2_55033 = factory_55033((a: { test: number }, b: string) => {})( function factory_55033_2(cb: (...args: T) => void) { >factory_55033_2 : (cb: (...args: T) => void) => (...args: K) => K -> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^ +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >cb : (...args: T) => void > : ^^^^ ^^ ^^^^^ >args : T @@ -851,7 +851,7 @@ const t1_55033_2 = factory_55033_2((a: { test: number }, b: string) => {})( >factory_55033_2((a: { test: number }, b: string) => {}) : (...args: K) => K > : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ >factory_55033_2 : (cb: (...args: T) => void) => (...args: K) => K -> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^ +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >(a: { test: number }, b: string) => {} : (a: { test: number; }, b: string) => void > : ^ ^^ ^^ ^^ ^^^^^^^^^ >a : { test: number; } @@ -883,7 +883,7 @@ const t2_55033_2 = factory_55033_2((a: { test: number }, b: string) => {})( >factory_55033_2((a: { test: number }, b: string) => {}) : (...args: K) => K > : ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ >factory_55033_2 : (cb: (...args: T) => void) => (...args: K) => K -> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^ +> : ^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^ ^^ ^^^^^ >(a: { test: number }, b: string) => {} : (a: { test: number; }, b: string) => void > : ^ ^^ ^^ ^^ ^^^^^^^^^ >a : { test: number; } diff --git a/tests/baselines/reference/typePredicateFreshLiteralWidening.types b/tests/baselines/reference/typePredicateFreshLiteralWidening.types index 98bba0521ee..83f8935c32f 100644 --- a/tests/baselines/reference/typePredicateFreshLiteralWidening.types +++ b/tests/baselines/reference/typePredicateFreshLiteralWidening.types @@ -14,11 +14,11 @@ type Narrow = (A extends Narrowable ? A : never) | ({ const satisfies = >satisfies : () => (narrow: Narrow) => Narrow -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ () => >() => (narrow: Narrow) => narrow : () => (narrow: Narrow) => Narrow -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ (narrow: Narrow) => >(narrow: Narrow) => narrow : (narrow: Narrow) => Narrow @@ -58,7 +58,7 @@ const item1 = satisfies()({ value: "1" }); >satisfies() : (narrow: Narrow) => Narrow > : ^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >satisfies : () => (narrow: Narrow) => Narrow -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ >{ value: "1" } : { value: "1"; } > : ^^^^^^^^^^^^^^^ >value : "1" @@ -74,7 +74,7 @@ const item2 = satisfies()({ value: "2" }); >satisfies() : (narrow: Narrow) => Narrow > : ^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >satisfies : () => (narrow: Narrow) => Narrow -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ >{ value: "2" } : { value: "2"; } > : ^^^^^^^^^^^^^^^ >value : "2" @@ -90,7 +90,7 @@ const item3 = satisfies()({ value: null }); >satisfies() : (narrow: Narrow) => Narrow > : ^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >satisfies : () => (narrow: Narrow) => Narrow -> : ^ ^^^^^^^^ ^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^ +> : ^ ^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ >{ value: null } : { value: null; } > : ^^^^^^^^^^^^^^^^ >value : null diff --git a/tests/baselines/reference/unusedParametersInLambda1.types b/tests/baselines/reference/unusedParametersInLambda1.types index cde9f975b37..2e5884cb6e3 100644 --- a/tests/baselines/reference/unusedParametersInLambda1.types +++ b/tests/baselines/reference/unusedParametersInLambda1.types @@ -7,7 +7,7 @@ class A { public f1() { >f1 : () => (X: any) => void -> : ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^^^^^^^^ return (X) => { >(X) => { } : (X: any) => void diff --git a/tests/baselines/reference/unusedParametersInLambda2.types b/tests/baselines/reference/unusedParametersInLambda2.types index d4f74b53e46..5b288ab2928 100644 --- a/tests/baselines/reference/unusedParametersInLambda2.types +++ b/tests/baselines/reference/unusedParametersInLambda2.types @@ -7,7 +7,7 @@ class A { public f1() { >f1 : () => (X: any, Y: any) => void -> : ^^^^^^^ ^^^^^^^ ^^^^^^^^^^^^^^ +> : ^^^^^^^ ^^^^^ ^^^^^^^^^^^^ return (X, Y) => { >(X, Y) => { Y; } : (X: any, Y: any) => void diff --git a/tests/baselines/reference/variadicTuples1.js b/tests/baselines/reference/variadicTuples1.js index e0b343b3c68..ea3caaec1e3 100644 --- a/tests/baselines/reference/variadicTuples1.js +++ b/tests/baselines/reference/variadicTuples1.js @@ -823,7 +823,7 @@ declare function getOrgUser(id: string, orgId: number, options?: { y?: number; z?: boolean; }): void; -declare function callApi(method: (...args: [...T, object]) => U): (...args: T) => U; +declare function callApi(method: (...args: [...T, object]) => U): (...args: [...T]) => U; type Numbers = number[]; type Unbounded = [...Numbers, boolean]; declare const data: Unbounded; diff --git a/tests/baselines/reference/variadicTuples1.types b/tests/baselines/reference/variadicTuples1.types index a4db4781503..8f6c40a0a80 100644 --- a/tests/baselines/reference/variadicTuples1.types +++ b/tests/baselines/reference/variadicTuples1.types @@ -1601,7 +1601,7 @@ type R36 = DropLast; function curry(f: (...args: [...T, ...U]) => R, ...a: T) { >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >f : (...args: [...T, ...U]) => R > : ^^^^ ^^ ^^^^^ >args : [...T, ...U] @@ -1650,7 +1650,7 @@ const c0 = curry(fn1); // (a: number, b: string, c: boolean, d: string[]) => nu >curry(fn1) : (a: number, b: string, c: boolean, d: string[]) => number > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn1 : (a: number, b: string, c: boolean, d: string[]) => number > : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^ @@ -1660,7 +1660,7 @@ const c1 = curry(fn1, 1); // (b: string, c: boolean, d: string[]) => number >curry(fn1, 1) : (b: string, c: boolean, d: string[]) => number > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn1 : (a: number, b: string, c: boolean, d: string[]) => number > : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^ >1 : 1 @@ -1672,7 +1672,7 @@ const c2 = curry(fn1, 1, 'abc'); // (c: boolean, d: string[]) => number >curry(fn1, 1, 'abc') : (c: boolean, d: string[]) => number > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn1 : (a: number, b: string, c: boolean, d: string[]) => number > : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^ >1 : 1 @@ -1686,7 +1686,7 @@ const c3 = curry(fn1, 1, 'abc', true); // (d: string[]) => number >curry(fn1, 1, 'abc', true) : (d: string[]) => number > : ^^^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn1 : (a: number, b: string, c: boolean, d: string[]) => number > : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^ >1 : 1 @@ -1702,7 +1702,7 @@ const c4 = curry(fn1, 1, 'abc', true, ['x', 'y']); // () => number >curry(fn1, 1, 'abc', true, ['x', 'y']) : () => number > : ^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn1 : (a: number, b: string, c: boolean, d: string[]) => number > : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^ >1 : 1 @@ -1738,7 +1738,7 @@ const c10 = curry(fn2); // (x: number, b: boolean, ...args: string[]) => number >curry(fn2) : (x: number, b: boolean, ...args: string[]) => number > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn2 : (x: number, b: boolean, ...args: string[]) => number > : ^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^^^ @@ -1748,7 +1748,7 @@ const c11 = curry(fn2, 1); // (b: boolean, ...args: string[]) => number >curry(fn2, 1) : (b: boolean, ...args: string[]) => number > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn2 : (x: number, b: boolean, ...args: string[]) => number > : ^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^^^ >1 : 1 @@ -1760,7 +1760,7 @@ const c12 = curry(fn2, 1, true); // (...args: string[]) => number >curry(fn2, 1, true) : (...b: string[]) => number > : ^^^^ ^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn2 : (x: number, b: boolean, ...args: string[]) => number > : ^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^^^ >1 : 1 @@ -1774,7 +1774,7 @@ const c13 = curry(fn2, 1, true, 'abc', 'def'); // (...args: string[]) => number >curry(fn2, 1, true, 'abc', 'def') : (...b: string[]) => number > : ^^^^ ^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn2 : (x: number, b: boolean, ...args: string[]) => number > : ^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^^^ >1 : 1 @@ -1802,7 +1802,7 @@ const c20 = curry(fn3); // (...args: string[]) => number >curry(fn3) : (...b: string[]) => number > : ^^^^ ^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn3 : (...args: string[]) => number > : ^^^^ ^^ ^^^^^^^^^^^ @@ -1812,7 +1812,7 @@ const c21 = curry(fn3, 'abc', 'def'); // (...args: string[]) => number >curry(fn3, 'abc', 'def') : (...b: string[]) => number > : ^^^^ ^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn3 : (...args: string[]) => number > : ^^^^ ^^ ^^^^^^^^^^^ >'abc' : "abc" @@ -1826,7 +1826,7 @@ const c22 = curry(fn3, ...sa); // (...args: string[]) => number >curry(fn3, ...sa) : (...b: string[]) => number > : ^^^^ ^^^^^^^^^^^^^^^^^^^^^ >curry : (f: (...args: [...T, ...U]) => R, ...a: T) => (...b: U) => R -> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^ +> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^^^^ ^^ ^^^^^^ ^^^^^^ >fn3 : (...args: string[]) => number > : ^^^^ ^^ ^^^^^^^^^^^ >...sa : string @@ -2218,8 +2218,8 @@ declare function getOrgUser(id: string, orgId: number, options?: { y?: number, z > : ^^^^^^^^^^^^^^^^^^^ function callApi(method: (...args: [...T, object]) => U) { ->callApi : (method: (...args: [...T, object]) => U) => (...args: T) => U -> : ^ ^^^^^^^^^ ^^^^^^^ ^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^ +>callApi : (method: (...args: [...T, object]) => U) => (...args: [...T]) => U +> : ^ ^^^^^^^^^ ^^^^^^^ ^^^^^^^^^ ^^ ^^^^^^ ^^^^^^ >method : (...args: [...T, object]) => U > : ^^^^ ^^ ^^^^^ >args : [...T, object] @@ -2245,16 +2245,16 @@ function callApi(method: (...args: [...T, ob callApi(getUser); >callApi(getUser) : (id: string) => string > : ^^^^^^^^^^^^^^^^^^^^^^ ->callApi : (method: (...args: [...T, object]) => U) => (...args: T) => U -> : ^ ^^^^^^^^^ ^^^^^^^ ^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^ +>callApi : (method: (...args: [...T, object]) => U) => (...args: [...T]) => U +> : ^ ^^^^^^^^^ ^^^^^^^ ^^^^^^^^^ ^^ ^^^^^^ ^^^^^^ >getUser : (id: string, options?: { x?: string; }) => string > : ^ ^^ ^^ ^^^ ^^^^^ callApi(getOrgUser); >callApi(getOrgUser) : (id: string, orgId: number) => void > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->callApi : (method: (...args: [...T, object]) => U) => (...args: T) => U -> : ^ ^^^^^^^^^ ^^^^^^^ ^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^ +>callApi : (method: (...args: [...T, object]) => U) => (...args: [...T]) => U +> : ^ ^^^^^^^^^ ^^^^^^^ ^^^^^^^^^ ^^ ^^^^^^ ^^^^^^ >getOrgUser : (id: string, orgId: number, options?: { y?: number; z?: boolean; }) => void > : ^ ^^ ^^ ^^ ^^ ^^^ ^^^^^ diff --git a/tests/cases/compiler/spreadParameterTupleType.ts b/tests/cases/compiler/spreadParameterTupleType.ts index f626df3e7e1..e371647c6b3 100644 --- a/tests/cases/compiler/spreadParameterTupleType.ts +++ b/tests/cases/compiler/spreadParameterTupleType.ts @@ -4,7 +4,7 @@ function f1() { type A = [s: string]; type C = [...A, ...A]; - return function fn(...args: C) { } + return function fn(...args: C) { } satisfies any } function f2() { @@ -13,5 +13,5 @@ function f2() { type C = [c: string]; type D = [...A, ...A, ...B, ...A, ...B, ...B, ...A, ...C]; - return function fn(...args: D) { } + return function fn(...args: D) { } satisfies any; }