2014-07-13 01:04:16 +02:00
|
|
|
//// [typeInfer1.ts]
|
|
|
|
interface ITextWriter2 {
|
|
|
|
Write(s:string):void;
|
|
|
|
WriteLine(s:string):void;
|
|
|
|
}
|
|
|
|
|
|
|
|
var x: ITextWriter2 = {
|
|
|
|
Write: function (s:string):void {},
|
|
|
|
WriteLine: function(s:string):void {}
|
|
|
|
}
|
|
|
|
|
|
|
|
var yyyyyyyy: ITextWriter2 = {
|
|
|
|
Moo: function() { return "cow"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
//// [typeInfer1.js]
|
|
|
|
var x = {
|
2015-02-07 03:45:09 +01:00
|
|
|
Write: function (s) { },
|
|
|
|
WriteLine: function (s) { }
|
2014-07-13 01:04:16 +02:00
|
|
|
};
|
|
|
|
var yyyyyyyy = {
|
2015-02-07 05:03:24 +01:00
|
|
|
Moo: function () { return "cow"; }
|
2014-07-13 01:04:16 +02:00
|
|
|
};
|