2015-02-03 00:15:54 +01:00
|
|
|
//// [contextualTypingOfAccessors.ts]
|
|
|
|
// not contextually typing accessors
|
|
|
|
|
|
|
|
var x: {
|
|
|
|
foo: (x: number) => number;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = {
|
|
|
|
get foo() {
|
|
|
|
return (n)=>n
|
|
|
|
},
|
|
|
|
set foo(x) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//// [contextualTypingOfAccessors.js]
|
|
|
|
// not contextually typing accessors
|
|
|
|
var x;
|
|
|
|
x = {
|
|
|
|
get foo() {
|
|
|
|
return function (n) { return n; };
|
|
|
|
},
|
2015-02-07 03:45:09 +01:00
|
|
|
set foo(x) { }
|
2015-02-03 00:15:54 +01:00
|
|
|
};
|