Skip to content

Commit 856961b

Browse files
authored
Add regression test for #18668 (#19085)
1 parent d7269f1 commit 856961b

4 files changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//// [castFunctionExpressionShouldBeParenthesized.ts]
2+
(function a() { } as any)().foo()
3+
4+
//// [castFunctionExpressionShouldBeParenthesized.js]
5+
(function a() { }().foo());
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
=== tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts ===
2+
(function a() { } as any)().foo()
3+
>a : Symbol(a, Decl(castFunctionExpressionShouldBeParenthesized.ts, 0, 1))
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
=== tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts ===
2+
(function a() { } as any)().foo()
3+
>(function a() { } as any)().foo() : any
4+
>(function a() { } as any)().foo : any
5+
>(function a() { } as any)() : any
6+
>(function a() { } as any) : any
7+
>function a() { } as any : any
8+
>function a() { } : () => void
9+
>a : () => void
10+
>foo : any
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(function a() { } as any)().foo()

0 commit comments

Comments
 (0)