Skip to content

Commit

Permalink
Add regression test for #18668 (#19085)
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham authored Oct 11, 2017
1 parent d7269f1 commit 856961b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//// [castFunctionExpressionShouldBeParenthesized.ts]
(function a() { } as any)().foo()

//// [castFunctionExpressionShouldBeParenthesized.js]
(function a() { }().foo());
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
=== tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts ===
(function a() { } as any)().foo()
>a : Symbol(a, Decl(castFunctionExpressionShouldBeParenthesized.ts, 0, 1))

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
=== tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts ===
(function a() { } as any)().foo()
>(function a() { } as any)().foo() : any
>(function a() { } as any)().foo : any
>(function a() { } as any)() : any
>(function a() { } as any) : any
>function a() { } as any : any
>function a() { } : () => void
>a : () => void
>foo : any

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(function a() { } as any)().foo()

0 comments on commit 856961b

Please sign in to comment.