TypeScript Version: nightly (2.1.0-dev.20161004)
Code
// @target: es5
async function foo(): string { // OK, but should be error
return 'foo';
}
let s = foo(); // OK, type of s is string, but should be Promise
s = s.concat('bar'); // OK, but runtime error 's.concat is not a function'
Expected behavior:
Compiler error on foo declaration about invalid return type annotation.
Actual behavior:
Compiles without errors and crashes at runtime.
TypeScript Version: nightly (2.1.0-dev.20161004)
Code
Expected behavior:
Compiler error on
foodeclaration about invalid return type annotation.Actual behavior:
Compiles without errors and crashes at runtime.