-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version:
1.8
Code
// file: index.ts
declare class Promise<T> {/***/}
async function foo() { return 42; } // ERROR: Async functions are only available in ES6+
let bar = async function () { return 42; } // OK, but should be an error
let baz = async () => 42; // OK, but should be an error
// file: tsconfig.json
{
"compilerOptions": {
"target": "es5"
}
}Expected behavior:
The bar and baz lines should also get error TS1311 'Async functions are only available in ES6 or higher'.
Actual behavior:
The bar and baz lines compile without errors.
nevir and zpdDG4gta8XKpMCd
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue