You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compiler allows async function expressions in ES3/ES5 #7334
// file: index.tsdeclareclassPromise<T>{/***/}asyncfunctionfoo(){return42;}// ERROR: Async functions are only available in ES6+letbar=asyncfunction(){return42;}// OK, but should be an errorletbaz=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.
Activity
zpdDG4gta8XKpMCd commentedon Jun 7, 2016
#8581 might me related
zpdDG4gta8XKpMCd commentedon Jun 7, 2016
also might relate: #8584