TypeScript Version:
nightly (1.9.0-dev.20160429)
Code
const foo = {
_foo: 'bar',
get foo() { // <- 'foo' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
return this._foo;
},
set foo(value) { // <- 'value' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
this._foo = value;
}
};
Expected behavior:
No errors.
Actual behavior:
With the compiler option noImplicitAny = true and inferred object literal typing, the compiler is complaining that get and set accessors have inferred any types, when though it is logical that the type of string can be inferred from the context (or at least I am missing the reason why it cannot be inferred).
TypeScript Version:
nightly (1.9.0-dev.20160429)
Code
Expected behavior:
No errors.
Actual behavior:
With the compiler option
noImplicitAny = trueand inferred object literal typing, the compiler is complaining thatgetandsetaccessors have inferredanytypes, when though it is logical that the type ofstringcan be inferred from the context (or at least I am missing the reason why it cannot be inferred).