TypeScript/tests/baselines/reference/extendNumberInterface.js

19 lines
418 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [extendNumberInterface.ts]
interface Number {
doStuff(): string;
doOtherStuff<T>(x:T): T;
}
var x = 1;
var a: string = x.doStuff();
var b: string = x.doOtherStuff('hm');
var c: string = x['doStuff']();
var d: string = x['doOtherStuff']('hm');
//// [extendNumberInterface.js]
var x = 1;
var a = x.doStuff();
var b = x.doOtherStuff('hm');
var c = x['doStuff']();
var d = x['doOtherStuff']('hm');