mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
27 lines
479 B
TypeScript
27 lines
479 B
TypeScript
//// [tests/cases/compiler/betterErrorForAccidentalCall.ts] ////
|
|
|
|
//// [betterErrorForAccidentalCall.ts]
|
|
declare function foo(): string;
|
|
|
|
foo()(1 as number).toString();
|
|
|
|
foo() (1 as number).toString();
|
|
|
|
foo()
|
|
(1 as number).toString();
|
|
|
|
foo()
|
|
(1 + 2).toString();
|
|
|
|
foo()
|
|
(<number>1).toString();
|
|
|
|
|
|
//// [betterErrorForAccidentalCall.js]
|
|
"use strict";
|
|
foo()(1).toString();
|
|
foo()(1).toString();
|
|
foo()(1).toString();
|
|
foo()(1 + 2).toString();
|
|
foo()(1).toString();
|