diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a5c161abae051..93d3cc9732de6 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -36385,7 +36385,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { if (result) { return result; } - result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode); + result = getCandidateForOverloadFailure(node, candidates, candidatesForArgumentError, args, !!candidatesOutArray, checkMode); // Preemptively cache the result; getResolvedSignature will do this after we return, but // we need to ensure that the result is present for the error checks below so that if // this signature is encountered again, we handle the circularity (rather than producing a @@ -36616,6 +36616,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function getCandidateForOverloadFailure( node: CallLikeExpression, candidates: Signature[], + candidatesForArgumentError: Signature[] | undefined, args: readonly Expression[], hasCandidatesOutArray: boolean, checkMode: CheckMode, @@ -36626,7 +36627,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // Don't do this if there is a `candidatesOutArray`, // because then we want the chosen best candidate to be one of the overloads, not a combination. return hasCandidatesOutArray || candidates.length === 1 || candidates.some(c => !!c.typeParameters) - ? pickLongestCandidateSignature(node, candidates, args, checkMode) + ? pickLongestCandidateSignature(node, candidates, candidatesForArgumentError, args, checkMode) : createUnionOfSignaturesForOverloadFailure(candidates); } @@ -36682,7 +36683,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return createSymbolWithType(first(sources), type); } - function pickLongestCandidateSignature(node: CallLikeExpression, candidates: Signature[], args: readonly Expression[], checkMode: CheckMode): Signature { + function pickLongestCandidateSignature(node: CallLikeExpression, candidates: Signature[], candidatesForArgumentError: Signature[] | undefined, args: readonly Expression[], checkMode: CheckMode): Signature { // Pick the longest signature. This way we can get a contextual type for cases like: // declare function f(a: { xa: number; xb: number; }, b: number); // f({ | @@ -36699,9 +36700,19 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const typeArgumentNodes: readonly TypeNode[] | undefined = callLikeExpressionMayHaveTypeArguments(node) ? node.typeArguments : undefined; const instantiated = typeArgumentNodes ? createSignatureInstantiation(candidate, getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, isInJSFile(node))) + // when there is only one candidate reuse existing *inferred* candidate for argument error (if available) + // this saves the compiler some extra work but more importantly it includes inferences made from context-sensitive arguments and generic functions + // which avoids confusing mismatches between inferred type arguments and reported argument error + // + // for the time being only do this when there is a single candidate as the origin index of the `candidatesForArgumentError` is not known + // and it could be different from the selected `bestIndex` here + : candidates.length === 1 && candidatesForArgumentError + ? candidatesForArgumentError[0] : inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args, checkMode); candidates[bestIndex] = instantiated; - return instantiated; + // for similar reasons as above, we reuse the already instantiated *single* candidatesForArgumentError here (even when there are more input candidates) + // this is the preferred candidate for which the signature errors are reported + return candidatesForArgumentError?.length === 1 ? candidatesForArgumentError[0] : instantiated; } function getTypeArgumentsFromNodes(typeArgumentNodes: readonly TypeNode[], typeParameters: readonly TypeParameter[], isJs: boolean): readonly Type[] { diff --git a/tests/baselines/reference/contextualSignatureInstantiation.errors.txt b/tests/baselines/reference/contextualSignatureInstantiation.errors.txt index 5d7e40740aa8a..6aced655193bf 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.errors.txt +++ b/tests/baselines/reference/contextualSignatureInstantiation.errors.txt @@ -1,12 +1,12 @@ -contextualSignatureInstantiation.ts(19,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'unknown'. +contextualSignatureInstantiation.ts(19,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'number'. contextualSignatureInstantiation.ts(19,13): error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: number, y: string) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -contextualSignatureInstantiation.ts(20,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'unknown'. +contextualSignatureInstantiation.ts(20,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'number'. contextualSignatureInstantiation.ts(20,23): error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: number, y: string) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -contextualSignatureInstantiation.ts(21,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'unknown'. +contextualSignatureInstantiation.ts(21,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'string'. contextualSignatureInstantiation.ts(21,23): error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: string, y: number) => string'. Types of parameters 'y' and 'y' are incompatible. Type 'number' is not assignable to type 'string'. @@ -33,7 +33,7 @@ contextualSignatureInstantiation.ts(21,23): error TS2345: Argument of type '( var b: number | string; var b = foo(g); // Error, number and string are disjoint types ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'unknown'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'number'. !!! related TS6203 contextualSignatureInstantiation.ts:18:5: 'b' was also declared here. ~ !!! error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: number, y: string) => number'. @@ -41,7 +41,7 @@ contextualSignatureInstantiation.ts(21,23): error TS2345: Argument of type '( !!! error TS2345: Type 'string' is not assignable to type 'number'. var b = bar(1, "one", g); // Error, number and string are disjoint types ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'unknown'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'number'. !!! related TS6203 contextualSignatureInstantiation.ts:18:5: 'b' was also declared here. ~ !!! error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: number, y: string) => number'. @@ -49,13 +49,15 @@ contextualSignatureInstantiation.ts(21,23): error TS2345: Argument of type '( !!! error TS2345: Type 'string' is not assignable to type 'number'. var b = bar("one", 1, g); // Error, number and string are disjoint types ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'unknown'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'string | number', but here has type 'string'. !!! related TS6203 contextualSignatureInstantiation.ts:18:5: 'b' was also declared here. ~ !!! error TS2345: Argument of type '(x: T, y: T) => T' is not assignable to parameter of type '(x: string, y: number) => string'. !!! error TS2345: Types of parameters 'y' and 'y' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. - var b = baz(b, b, g); // Should be number | string + + var b2: number | string; + var b2 = baz(b2, b2, g); // Should be number | string var d: number[] | string[]; var d = foo(h); // Should be number[] | string[] diff --git a/tests/baselines/reference/contextualSignatureInstantiation.js b/tests/baselines/reference/contextualSignatureInstantiation.js index 5ef5d170de473..f790166af303c 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.js +++ b/tests/baselines/reference/contextualSignatureInstantiation.js @@ -22,7 +22,9 @@ var b: number | string; var b = foo(g); // Error, number and string are disjoint types var b = bar(1, "one", g); // Error, number and string are disjoint types var b = bar("one", 1, g); // Error, number and string are disjoint types -var b = baz(b, b, g); // Should be number | string + +var b2: number | string; +var b2 = baz(b2, b2, g); // Should be number | string var d: number[] | string[]; var d = foo(h); // Should be number[] | string[] @@ -44,7 +46,8 @@ var b; var b = foo(g); // Error, number and string are disjoint types var b = bar(1, "one", g); // Error, number and string are disjoint types var b = bar("one", 1, g); // Error, number and string are disjoint types -var b = baz(b, b, g); // Should be number | string +var b2; +var b2 = baz(b2, b2, g); // Should be number | string var d; var d = foo(h); // Should be number[] | string[] var d = bar(1, "one", h); // Should be number[] | string[] diff --git a/tests/baselines/reference/contextualSignatureInstantiation.symbols b/tests/baselines/reference/contextualSignatureInstantiation.symbols index 0040bf228d704..890684fda4151 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.symbols +++ b/tests/baselines/reference/contextualSignatureInstantiation.symbols @@ -83,52 +83,55 @@ var a = baz(1, 1, g); // Should be number >g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) var b: number | string; ->b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3)) var b = foo(g); // Error, number and string are disjoint types ->b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3)) >foo : Symbol(foo, Decl(contextualSignatureInstantiation.ts, 0, 0)) >g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) var b = bar(1, "one", g); // Error, number and string are disjoint types ->b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3)) >bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) >g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) var b = bar("one", 1, g); // Error, number and string are disjoint types ->b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3)) >bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) >g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) -var b = baz(b, b, g); // Should be number | string ->b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +var b2: number | string; +>b2 : Symbol(b2, Decl(contextualSignatureInstantiation.ts, 22, 3), Decl(contextualSignatureInstantiation.ts, 23, 3)) + +var b2 = baz(b2, b2, g); // Should be number | string +>b2 : Symbol(b2, Decl(contextualSignatureInstantiation.ts, 22, 3), Decl(contextualSignatureInstantiation.ts, 23, 3)) >baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) ->b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) ->b : Symbol(b, Decl(contextualSignatureInstantiation.ts, 17, 3), Decl(contextualSignatureInstantiation.ts, 18, 3), Decl(contextualSignatureInstantiation.ts, 19, 3), Decl(contextualSignatureInstantiation.ts, 20, 3), Decl(contextualSignatureInstantiation.ts, 21, 3)) +>b2 : Symbol(b2, Decl(contextualSignatureInstantiation.ts, 22, 3), Decl(contextualSignatureInstantiation.ts, 23, 3)) +>b2 : Symbol(b2, Decl(contextualSignatureInstantiation.ts, 22, 3), Decl(contextualSignatureInstantiation.ts, 23, 3)) >g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) var d: number[] | string[]; ->d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3), Decl(contextualSignatureInstantiation.ts, 28, 3), Decl(contextualSignatureInstantiation.ts, 29, 3)) var d = foo(h); // Should be number[] | string[] ->d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3), Decl(contextualSignatureInstantiation.ts, 28, 3), Decl(contextualSignatureInstantiation.ts, 29, 3)) >foo : Symbol(foo, Decl(contextualSignatureInstantiation.ts, 0, 0)) >h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) var d = bar(1, "one", h); // Should be number[] | string[] ->d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3), Decl(contextualSignatureInstantiation.ts, 28, 3), Decl(contextualSignatureInstantiation.ts, 29, 3)) >bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) >h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) var d = bar("one", 1, h); // Should be number[] | string[] ->d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3), Decl(contextualSignatureInstantiation.ts, 28, 3), Decl(contextualSignatureInstantiation.ts, 29, 3)) >bar : Symbol(bar, Decl(contextualSignatureInstantiation.ts, 6, 60)) >h : Symbol(h, Decl(contextualSignatureInstantiation.ts, 10, 37)) var d = baz(d, d, g); // Should be number[] | string[] ->d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3), Decl(contextualSignatureInstantiation.ts, 28, 3), Decl(contextualSignatureInstantiation.ts, 29, 3)) >baz : Symbol(baz, Decl(contextualSignatureInstantiation.ts, 7, 68)) ->d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) ->d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 23, 3), Decl(contextualSignatureInstantiation.ts, 24, 3), Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3), Decl(contextualSignatureInstantiation.ts, 28, 3), Decl(contextualSignatureInstantiation.ts, 29, 3)) +>d : Symbol(d, Decl(contextualSignatureInstantiation.ts, 25, 3), Decl(contextualSignatureInstantiation.ts, 26, 3), Decl(contextualSignatureInstantiation.ts, 27, 3), Decl(contextualSignatureInstantiation.ts, 28, 3), Decl(contextualSignatureInstantiation.ts, 29, 3)) >g : Symbol(g, Decl(contextualSignatureInstantiation.ts, 8, 65)) diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types b/tests/baselines/reference/contextualSignatureInstantiation.types index 8b2fb9e27a584..abfaef9600cc0 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.types +++ b/tests/baselines/reference/contextualSignatureInstantiation.types @@ -100,8 +100,8 @@ var b: number | string; var b = foo(g); // Error, number and string are disjoint types >b : string | number > : ^^^^^^^^^^^^^^^ ->foo(g) : unknown -> : ^^^^^^^ +>foo(g) : number +> : ^^^^^^ >foo : (cb: (x: number, y: string) => T) => T > : ^ ^^ ^^ ^^^^^ >g : (x: T, y: T) => T @@ -110,8 +110,8 @@ var b = foo(g); // Error, number and string are disjoint types var b = bar(1, "one", g); // Error, number and string are disjoint types >b : string | number > : ^^^^^^^^^^^^^^^ ->bar(1, "one", g) : unknown -> : ^^^^^^^ +>bar(1, "one", g) : number +> : ^^^^^^ >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V > : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ >1 : 1 @@ -124,8 +124,8 @@ var b = bar(1, "one", g); // Error, number and string are disjoint types var b = bar("one", 1, g); // Error, number and string are disjoint types >b : string | number > : ^^^^^^^^^^^^^^^ ->bar("one", 1, g) : unknown -> : ^^^^^^^ +>bar("one", 1, g) : string +> : ^^^^^^ >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V > : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ >"one" : "one" @@ -135,17 +135,21 @@ var b = bar("one", 1, g); // Error, number and string are disjoint types >g : (x: T, y: T) => T > : ^ ^^ ^^ ^^ ^^ ^^^^^ -var b = baz(b, b, g); // Should be number | string ->b : string | number -> : ^^^^^^^^^^^^^^^ ->baz(b, b, g) : string | number -> : ^^^^^^^^^^^^^^^ +var b2: number | string; +>b2 : string | number +> : ^^^^^^^^^^^^^^^ + +var b2 = baz(b2, b2, g); // Should be number | string +>b2 : string | number +> : ^^^^^^^^^^^^^^^ +>baz(b2, b2, g) : string | number +> : ^^^^^^^^^^^^^^^ >baz : (x: T, y: T, cb: (x: T, y: T) => U) => U > : ^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^^^ ->b : string | number -> : ^^^^^^^^^^^^^^^ ->b : string | number -> : ^^^^^^^^^^^^^^^ +>b2 : string | number +> : ^^^^^^^^^^^^^^^ +>b2 : string | number +> : ^^^^^^^^^^^^^^^ >g : (x: T, y: T) => T > : ^ ^^ ^^ ^^ ^^ ^^^^^ diff --git a/tests/baselines/reference/generatorTypeCheck62.types b/tests/baselines/reference/generatorTypeCheck62.types index 6196ace757ddb..0a4b1e599cf2e 100644 --- a/tests/baselines/reference/generatorTypeCheck62.types +++ b/tests/baselines/reference/generatorTypeCheck62.types @@ -117,8 +117,8 @@ export const Nothing2: Strategy = strategy("Nothing", function*(state: St export const Nothing3: Strategy = strategy("Nothing", function* (state: State) { >Nothing3 : Strategy > : ^^^^^^^^^^^^^^^ ->strategy("Nothing", function* (state: State) { yield ; return state; // `return`/`TReturn` isn't supported by `strategy`, so this should error.}) : (a: State) => IterableIterator -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>strategy("Nothing", function* (state: State) { yield ; return state; // `return`/`TReturn` isn't supported by `strategy`, so this should error.}) : (a: any) => IterableIterator +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >strategy : (stratName: string, gen: (a: T) => IterableIterator) => (a: T) => IterableIterator > : ^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^ >"Nothing" : "Nothing" diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.types index a513880423170..8d6080a29904a 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.types @@ -50,10 +50,10 @@ var r = foo(arg); // {} // more args not allowed var r2 = foo({ cb: (x: T, y: T) => '' }); // error ->r2 : unknown -> : ^^^^^^^ ->foo({ cb: (x: T, y: T) => '' }) : unknown -> : ^^^^^^^ +>r2 : string +> : ^^^^^^ +>foo({ cb: (x: T, y: T) => '' }) : string +> : ^^^^^^ >foo : (arg: { cb: (t: T) => U; }) => U > : ^ ^^ ^^ ^^ ^^^^^^ >{ cb: (x: T, y: T) => '' } : { cb: (x: T, y: T) => string; } diff --git a/tests/baselines/reference/genericCombinators2.types b/tests/baselines/reference/genericCombinators2.types index 37a441ff08f22..c8d69efcc4e40 100644 --- a/tests/baselines/reference/genericCombinators2.types +++ b/tests/baselines/reference/genericCombinators2.types @@ -76,10 +76,10 @@ var rf1 = (x: number, y: string) => { return x.toFixed() }; > : ^ ^^^ ^^^^^ var r5a = _.map(c2, (x, y) => { return x.toFixed() }); ->r5a : Collection -> : ^^^^^^^^^^^^^^^^^^^^ ->_.map(c2, (x, y) => { return x.toFixed() }) : Collection -> : ^^^^^^^^^^^^^^^^^^^^ +>r5a : Collection +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>_.map(c2, (x, y) => { return x.toFixed() }) : Collection +> : ^^^^^^^^^^^^^^^^^^^^^^^^ >_.map : { (c: Collection, f: (x: T, y: U) => any): Collection; (c: Collection, f: (x: T, y: U) => V): Collection; } > : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >_ : Combinators @@ -104,10 +104,10 @@ var r5a = _.map(c2, (x, y) => { return x.toFixed() }); > : ^ ^^^ ^^^^^ var r5b = _.map(c2, rf1); ->r5b : Collection -> : ^^^^^^^^^^^^^^^^^^^^ ->_.map(c2, rf1) : Collection -> : ^^^^^^^^^^^^^^^^^^^^ +>r5b : Collection +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>_.map(c2, rf1) : Collection +> : ^^^^^^^^^^^^^^^^^^^^^^^^ >_.map : { (c: Collection, f: (x: T, y: U) => any): Collection; (c: Collection, f: (x: T, y: U) => V): Collection; } > : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ >_ : Combinators diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.types b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.types index cca446c5b1fe9..f9c41cfc511f1 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.types +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.types @@ -33,8 +33,8 @@ declare function testError(a: (t: T, t1: T) => void): T // more args testError((t1: D, t2, t3) => {}) ->testError((t1: D, t2, t3) => {}) : C -> : ^ +>testError((t1: D, t2, t3) => {}) : any +> : ^^^ >testError : (a: (t: T, t1: T) => void) => T > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ >(t1: D, t2, t3) => {} : (t1: D, t2: any, t3: any) => void @@ -47,8 +47,8 @@ testError((t1: D, t2, t3) => {}) > : ^^^ testError((t1, t2: D, t3) => {}) ->testError((t1, t2: D, t3) => {}) : C -> : ^ +>testError((t1, t2: D, t3) => {}) : any +> : ^^^ >testError : (a: (t: T, t1: T) => void) => T > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ >(t1, t2: D, t3) => {} : (t1: any, t2: D, t3: any) => void @@ -61,8 +61,8 @@ testError((t1, t2: D, t3) => {}) > : ^^^ testError((t1, t2, t3: D) => {}) ->testError((t1, t2, t3: D) => {}) : C -> : ^ +>testError((t1, t2, t3: D) => {}) : any +> : ^^^ >testError : (a: (t: T, t1: T) => void) => T > : ^ ^^^^^^^^^ ^^ ^^ ^^^^^ >(t1, t2, t3: D) => {} : (t1: any, t2: any, t3: D) => void diff --git a/tests/baselines/reference/promisePermutations2.types b/tests/baselines/reference/promisePermutations2.types index 5509ed1e8cf36..11239361753ed 100644 --- a/tests/baselines/reference/promisePermutations2.types +++ b/tests/baselines/reference/promisePermutations2.types @@ -1417,10 +1417,10 @@ var s8: Promise; > : ^^^^^^^^^^^^^^^ var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error ->s8a : Promise -> : ^^^^^^^^^^^^^^^^ ->s8.then(testFunction8, testFunction8, testFunction8) : Promise -> : ^^^^^^^^^^^^^^^^ +>s8a : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^^ +>s8.then(testFunction8, testFunction8, testFunction8) : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^^ >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } > : ^^^ ^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^ ^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^ ^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >s8 : Promise @@ -1435,10 +1435,10 @@ var s8a = s8.then(testFunction8, testFunction8, testFunction8); // error > : ^ ^^ ^^ ^^ ^^ ^^^^^ var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error ->s8b : Promise -> : ^^^^^^^^^^^^^^^^ ->s8.then(testFunction8P, testFunction8P, testFunction8P) : Promise -> : ^^^^^^^^^^^^^^^^ +>s8b : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^ +>s8.then(testFunction8P, testFunction8P, testFunction8P) : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^ >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } > : ^^^ ^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^ ^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^ ^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >s8 : Promise @@ -1453,10 +1453,10 @@ var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); // error > : ^ ^^ ^^ ^^ ^^ ^^^^^ var s8c = s8.then(testFunction8P, testFunction8, testFunction8); // error ->s8c : Promise -> : ^^^^^^^^^^^^^^^^ ->s8.then(testFunction8P, testFunction8, testFunction8) : Promise -> : ^^^^^^^^^^^^^^^^ +>s8c : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^^ +>s8.then(testFunction8P, testFunction8, testFunction8) : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^^ >s8.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } > : ^^^ ^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^ ^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^ ^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >s8 : Promise @@ -1611,10 +1611,10 @@ var s9: Promise; > : ^^^^^^^^^^^^^^^ var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error ->s9a : Promise -> : ^^^^^^^^^^^^^^^^ ->s9.then(testFunction9, testFunction9, testFunction9) : Promise -> : ^^^^^^^^^^^^^^^^ +>s9a : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^^ +>s9.then(testFunction9, testFunction9, testFunction9) : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^^ >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } > : ^^^ ^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^ ^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^ ^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >s9 : Promise @@ -1629,10 +1629,10 @@ var s9a = s9.then(testFunction9, testFunction9, testFunction9); // error > : ^ ^^ ^^ ^^ ^^ ^^^^^ var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error ->s9b : Promise -> : ^^^^^^^^^^^^^^^^ ->s9.then(testFunction9P, testFunction9P, testFunction9P) : Promise -> : ^^^^^^^^^^^^^^^^ +>s9b : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^ +>s9.then(testFunction9P, testFunction9P, testFunction9P) : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^ >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } > : ^^^ ^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^ ^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^ ^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >s9 : Promise @@ -1647,10 +1647,10 @@ var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); // error > : ^ ^^ ^^ ^^ ^^ ^^^^^ var s9c = s9.then(testFunction9P, testFunction9, testFunction9); // error ->s9c : Promise -> : ^^^^^^^^^^^^^^^^ ->s9.then(testFunction9P, testFunction9, testFunction9) : Promise -> : ^^^^^^^^^^^^^^^^ +>s9c : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^^ +>s9.then(testFunction9P, testFunction9, testFunction9) : Promise> +> : ^^^^^^^^^^^^^^^^^^^^^^ >s9.then : { (onfulfilled?: (value: number) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike): Promise; (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void): Promise; } > : ^^^ ^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^ ^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^ ^^^^ ^^ ^^^^^ ^^^^^^^^^^^^^^^^ >s9 : Promise diff --git a/tests/baselines/reference/promisePermutations3.types b/tests/baselines/reference/promisePermutations3.types index 80b307742233b..603abb9df8097 100644 --- a/tests/baselines/reference/promisePermutations3.types +++ b/tests/baselines/reference/promisePermutations3.types @@ -1366,10 +1366,10 @@ var nPromise: (x: any) => Promise; > : ^^^ var r8a = r8.then(testFunction8, testFunction8, testFunction8); // error ->r8a : IPromise -> : ^^^^^^^^^^^^^^^^^ ->r8.then(testFunction8, testFunction8, testFunction8) : IPromise -> : ^^^^^^^^^^^^^^^^^ +>r8a : IPromise> +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>r8.then(testFunction8, testFunction8, testFunction8) : IPromise> +> : ^^^^^^^^^^^^^^^^^^^^^^^ >r8.then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise > : ^ ^^ ^^^^ ^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^ >r8 : IPromise @@ -1506,10 +1506,10 @@ var r9: IPromise; > : ^^^^^^^^^^^^^^^^ var r9a = r9.then(testFunction9, testFunction9, testFunction9); // error ->r9a : IPromise -> : ^^^^^^^^^^^^^^^^^ ->r9.then(testFunction9, testFunction9, testFunction9) : IPromise -> : ^^^^^^^^^^^^^^^^^ +>r9a : IPromise> +> : ^^^^^^^^^^^^^^^^^^^^^^^ +>r9.then(testFunction9, testFunction9, testFunction9) : IPromise> +> : ^^^^^^^^^^^^^^^^^^^^^^^ >r9.then : (success?: (value: number) => U, error?: (error: any) => U, progress?: (progress: any) => void) => IPromise > : ^ ^^ ^^^^ ^^^^^^^^^^^^^^^^ ^^^^ ^^ ^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^ >r9 : IPromise diff --git a/tests/baselines/reference/promiseTry.types b/tests/baselines/reference/promiseTry.types index 53f4ea90b683f..5183cff30f979 100644 --- a/tests/baselines/reference/promiseTry.types +++ b/tests/baselines/reference/promiseTry.types @@ -108,8 +108,8 @@ Promise.try((foo) => "Async result", "foo"); // @ts-expect-error too few parameters Promise.try((foo) => "Async result"); ->Promise.try((foo) => "Async result") : Promise -> : ^^^^^^^^^^^^^^^^ +>Promise.try((foo) => "Async result") : Promise +> : ^^^^^^^^^^^^^^^ >Promise.try : (callbackFn: (...args: U) => T | PromiseLike, ...args: U) => Promise> > : ^ ^^ ^^^^^^^^^ ^^ ^^ ^^^^^ ^^ ^^^^^ >Promise : PromiseConstructor diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts b/tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts index 30c6579dabb07..c54595f6fe46f 100644 --- a/tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts +++ b/tests/cases/conformance/types/typeRelationships/typeInference/contextualSignatureInstantiation.ts @@ -19,7 +19,9 @@ var b: number | string; var b = foo(g); // Error, number and string are disjoint types var b = bar(1, "one", g); // Error, number and string are disjoint types var b = bar("one", 1, g); // Error, number and string are disjoint types -var b = baz(b, b, g); // Should be number | string + +var b2: number | string; +var b2 = baz(b2, b2, g); // Should be number | string var d: number[] | string[]; var d = foo(h); // Should be number[] | string[] diff --git a/tests/cases/fourslash/completionsFailedInferenceWithContextSensitiveArg1.ts b/tests/cases/fourslash/completionsFailedInferenceWithContextSensitiveArg1.ts new file mode 100644 index 0000000000000..96e7510fc3a5c --- /dev/null +++ b/tests/cases/fourslash/completionsFailedInferenceWithContextSensitiveArg1.ts @@ -0,0 +1,18 @@ +/// + +// https://github.com/microsoft/TypeScript/issues/61500 + +//// declare function makeRequest( +//// getFn: (client: { prop: number }) => QueryParam, +//// params: NoInfer, +//// ): void; +//// +//// makeRequest((client) => client, {/*1*/}); +//// +//// // for comparison +//// makeRequest((client: { prop: number }) => client, {/*2*/}); + +verify.completions({ + marker: ["1", "2"], + exact: ["prop"], +}); diff --git a/tests/cases/fourslash/quickInfoFailedInferenceWithContextSensitiveArg1.ts b/tests/cases/fourslash/quickInfoFailedInferenceWithContextSensitiveArg1.ts new file mode 100644 index 0000000000000..a762efb7db0b7 --- /dev/null +++ b/tests/cases/fourslash/quickInfoFailedInferenceWithContextSensitiveArg1.ts @@ -0,0 +1,32 @@ +/// + +// https://github.com/microsoft/TypeScript/issues/61500 + +//// declare function makeRequest( +//// getFn: (client: { prop: number }) => QueryParam, +//// params: NoInfer, +//// ): void; +//// +//// makeRequest/*1*/((client) => client, {}); +//// +//// // for comparison +//// makeRequest/*2*/((client: { prop: number }) => client, {}); + +verify.quickInfoAt("1", `function makeRequest<{ + prop: number; +}>(getFn: (client: { + prop: number; +}) => { + prop: number; +}, params: NoInfer<{ + prop: number; +}>): void`); +verify.quickInfoAt("2", `function makeRequest<{ + prop: number; +}>(getFn: (client: { + prop: number; +}) => { + prop: number; +}, params: NoInfer<{ + prop: number; +}>): void`); diff --git a/tests/cases/fourslash/quickInfoFailedInferenceWithContextSensitiveArg2.ts b/tests/cases/fourslash/quickInfoFailedInferenceWithContextSensitiveArg2.ts new file mode 100644 index 0000000000000..b85a56b21c560 --- /dev/null +++ b/tests/cases/fourslash/quickInfoFailedInferenceWithContextSensitiveArg2.ts @@ -0,0 +1,56 @@ +/// + +//// declare function f1( +//// keys: T[], +//// ): (handlers: { [P in keyof T2 & T]: (arg: P) => void }) => [ +//// T, +//// T2, +//// ]; +//// +//// const partialResult1 = f1(["foo"]); +//// +//// const result1 = /*1*/partialResult1({ +//// foo: (key) => {}, +//// [|bar|]: (key) => {}, +//// }); +//// +//// declare function f2( +//// keys: T[], +//// ): (handlers: { [P in keyof T2 & T]: (arg: P) => void }) => [ +//// T, +//// T2, +//// ]; +//// +//// const partialResult2 = f2(["foo"]); +//// +//// const result2 = /*2*/partialResult2({ +//// foo: (key) => {}, +//// [|bar|]: (key) => {}, +//// }); + +verify.quickInfoAt("1", `const partialResult1: <{ + foo: unknown; +}>(handlers: { + foo: (arg: "foo") => void; +}) => ["foo", { + foo: unknown; +}]`); +verify.quickInfoAt("2", `const partialResult2: <{ + foo: unknown; +}>(handlers: { + foo: (arg: "foo") => void; +}) => ["foo", { + foo: unknown; +}]`); + +const [r1, r2] = test.ranges(); + +verify.getSemanticDiagnostics([{ + message: "Object literal may only specify known properties, and 'bar' does not exist in type '{ foo: (arg: \"foo\") => void; }'.", + code: ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1.code, + range: r1, +}, { + message: "Object literal may only specify known properties, and 'bar' does not exist in type '{ foo: (arg: \"foo\") => void; }'.", + code: ts.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1.code, + range: r2, +}]); diff --git a/tests/cases/fourslash/quickInfoFailedInferenceWithGenericFunctionArgs1.ts b/tests/cases/fourslash/quickInfoFailedInferenceWithGenericFunctionArgs1.ts new file mode 100644 index 0000000000000..f933652d4a759 --- /dev/null +++ b/tests/cases/fourslash/quickInfoFailedInferenceWithGenericFunctionArgs1.ts @@ -0,0 +1,29 @@ +/// + +// @strict: true + +//// interface Effect { +//// _A: (_: void) => A; +//// _E: (_: void) => E; +//// _R: (_: void) => R; +//// +//// pipe(this: A, f: (a: A) => B): B; +//// +//// pipe(this: A, f: (a: A) => B, f2: (b: B) => C): C; +//// } +//// +//// type ServiceA = "@BLANK"; +//// +//// declare const effect: Effect; +//// +//// declare function toString(fa: Effect): Effect; +//// declare function test(fa: Effect): Effect; +//// +//// effect./*1*/pipe(toString, [|test|]); + +verify.quickInfoAt("1", `(method) Effect.pipe, Effect, Effect>(this: Effect, f: (a: Effect) => Effect, f2: (b: Effect) => Effect): Effect (+1 overload)`); + +verify.getSemanticDiagnostics([{ + message: "Argument of type '(fa: Effect) => Effect' is not assignable to parameter of type '(b: Effect) => Effect'.\n Types of parameters 'fa' and 'b' are incompatible.\n Type 'Effect' is not assignable to type 'Effect'.\n Type '\"@BLANK\"' is not assignable to type 'never'.", + code: ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code, +}]);