Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Alex2357
Alex2357 / TS2.0.6Bug.ts
Created October 30, 2016 22:49
C:\Users\Alex\WebstormProjects\Tutorial01\Tests>tsc TS2.0.6Bug.ts --target ES6 TS2.0.6Bug.ts(28,21): error TS2322: Type 'void | IFoo[]' is not assignable to ty pe 'IFoo[]'. Type 'void' is not assignable to type 'IFoo[]'.
interface IFoo{
square:number
}
(
async () => {
async function squareFun(i:number) : Promise<IFoo>{
if (i === 2)
throw 'squareFun1 throw 2';
@Alex2357
Alex2357 / TS2.0.6NoBug.ts
Created October 30, 2016 22:51
No bug C:\Users\Alex\WebstormProjects\Tutorial01\Tests>tsc TS2.0.6NoBug.ts --target ES6 C:\Users\Alex\WebstormProjects\Tutorial01\Tests>tsc TS2.0.6Bug.ts --target ES6 TS2.0.6Bug.ts(28,21): error TS2322: Type 'void | IFoo[]' is not assignable to ty pe 'IFoo[]'. Type 'void' is not assignable to type 'IFoo[]'. C:\Users\Alex\WebstormProjects\Tutoria…
interface IFoo{
square:number
}
(
async () => {
async function squareFun(i:number) : Promise<IFoo>{
if (i === 2)
throw 'squareFun1 throw 2';