Add regression test for #18668 (#19085)

This commit is contained in:
Wesley Wigham 2017-10-10 17:20:10 -07:00 committed by GitHub
parent d7269f1386
commit 856961b84c
4 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,5 @@
//// [castFunctionExpressionShouldBeParenthesized.ts]
(function a() { } as any)().foo()
//// [castFunctionExpressionShouldBeParenthesized.js]
(function a() { }().foo());

View file

@ -0,0 +1,4 @@
=== tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts ===
(function a() { } as any)().foo()
>a : Symbol(a, Decl(castFunctionExpressionShouldBeParenthesized.ts, 0, 1))

View file

@ -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

View file

@ -0,0 +1 @@
(function a() { } as any)().foo()