swc/crates/swc_ecma_parser/tests/tsc/asyncArrowFunction_allowJs.ts

27 lines
443 B
TypeScript
Raw Normal View History

// @allowJs: true
// @checkJs: true
// @noEmit: true
// @target: es2017
// @filename: file.js
// Error (good)
/** @type {function(): string} */
const a = () => 0
// Error (good)
/** @type {function(): string} */
const b = async () => 0
// No error (bad)
/** @type {function(): string} */
const c = async () => {
return 0
}
/** @type {function(function(): string): void} */
const f = (p) => {}
// Error (good)
f(async () => {
return 0
})