oxc/crates/oxc_isolated_declarations/tests/snapshots/async-function.snap

31 lines
909 B
Text

---
source: crates/oxc_isolated_declarations/tests/mod.rs
input_file: crates/oxc_isolated_declarations/tests/fixtures/async-function.ts
---
==================== .D.TS ====================
declare function asyncFunctionGood(): Promise<number>;
declare const asyncFunctionGoo2: () => Promise<number>;
declare function asyncFunction();
declare const asyncFunction2: unknown;
==================== Errors ====================
x TS9007: Function must have an explicit return type annotation with
| --isolatedDeclarations.
,-[10:16]
9 | // Incorrect
10 | async function asyncFunction() {
: ^^^^^^^^^^^^^
11 | return 42;
`----
x TS9007: Function must have an explicit return type annotation with
| --isolatedDeclarations.
,-[14:30]
13 |
14 | const asyncFunction2 = async () => {
: ^^^^^^^
15 | return "Hello, World!";
`----