TypeScript/tests/cases/compiler/numberToString.ts
2014-07-12 17:30:19 -07:00

11 lines
201 B
TypeScript

function f1(n:number):string {
return n; // error return type mismatch
}
function f2(s:string):void {
}
f1(3);
f2(3); // error no coercion to string
f2(3+""); // ok + operator promotes