2015-02-03 00:15:54 +01:00
|
|
|
//// [getsetReturnTypes.ts]
|
|
|
|
function makePoint(x: number) {
|
|
|
|
return {
|
|
|
|
get x() { return x; }
|
|
|
|
}
|
|
|
|
};
|
|
|
|
var x = makePoint(2).x;
|
|
|
|
var y: number = makePoint(2).x;
|
|
|
|
|
|
|
|
//// [getsetReturnTypes.js]
|
|
|
|
function makePoint(x) {
|
|
|
|
return {
|
2015-02-07 05:03:24 +01:00
|
|
|
get x() { return x; }
|
2015-02-03 00:15:54 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
;
|
|
|
|
var x = makePoint(2).x;
|
|
|
|
var y = makePoint(2).x;
|