mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 01:13:56 +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
|
|
}) |