Skip to content

Commit

Permalink
add extra test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Jan 27, 2025
1 parent ecc86b3 commit b0c4532
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,21 @@ export const output4 = test4<number>(() => (y: number) => 1);
output4(1);
>output4 : Symbol(output4, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 19, 12))

export declare function test5<X>(g: <A>(x: X) => X): typeof g<string>;
>test5 : Symbol(test5, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 20, 11))
>X : Symbol(X, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 22, 30))
>g : Symbol(g, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 22, 33))
>A : Symbol(A, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 22, 37))
>x : Symbol(x, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 22, 40))
>X : Symbol(X, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 22, 30))
>X : Symbol(X, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 22, 30))
>g : Symbol(g, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 22, 33))

export const output5 = test5<number>((y: number) => 1);
>output5 : Symbol(output5, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 23, 12))
>test5 : Symbol(test5, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 20, 11))
>y : Symbol(y, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 23, 38))

output5(1);
>output5 : Symbol(output5, Decl(instantiationExpressionNoTypeParameterLeak1.ts, 23, 12))

Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,35 @@ output4(1);
>1 : 1
> : ^

export declare function test5<X>(g: <A>(x: X) => X): typeof g<string>;
>test5 : <X>(g: <A>(x: X) => X) => typeof g<string>
> : ^ ^^ ^^ ^^^^^
>g : <A>(x: X) => X
> : ^ ^^ ^^ ^^^^^
>x : X
> : ^
>g : <A>(x: X) => X
> : ^ ^^ ^^ ^^^^^

export const output5 = test5<number>((y: number) => 1);
>output5 : (x: number) => number
> : ^ ^^^^^^^^^^^^^^^^^^^
>test5<number>((y: number) => 1) : (x: number) => number
> : ^ ^^^^^^^^^^^^^^^^^^^
>test5 : <X>(g: <A>(x: X) => X) => typeof g<string>
> : ^ ^^ ^^ ^^^^^
>(y: number) => 1 : (y: number) => number
> : ^ ^^ ^^^^^^^^^^^
>y : number
> : ^^^^^^
>1 : 1
> : ^

output5(1);
>output5(1) : number
> : ^^^^^^
>output5 : (x: number) => number
> : ^ ^^^^^^^^^^^^^^^^^^^
>1 : 1
> : ^

Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ export function test4<X>(g: <A>() => (x: X) => X) {
}
export const output4 = test4<number>(() => (y: number) => 1);
output4(1);

export declare function test5<X>(g: <A>(x: X) => X): typeof g<string>;
export const output5 = test5<number>((y: number) => 1);
output5(1);

0 comments on commit b0c4532

Please sign in to comment.