mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
27 lines
443 B
TypeScript
27 lines
443 B
TypeScript
// @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
|
|
}) |