Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed instantiation expression type param leak in body-less arrows #61054

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add extra test case
Andarist committed Jan 27, 2025
commit b0c4532707bb4f53546c2ee629c6f04add9375c5
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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);