I have the following code, where my getter's return type is any despite the real return type being obvious. There's some additional functions to trigger this behavior:
// This is required for repro
const wrapperFunction = <T>(obj: T) => obj;
const store = wrapperFunction({
value: 'Super max',
get simpleGetter() {
return this.value;
},
// This is required for repro
bark() {
console.log('WUF');
},
});
// This is any
const val = store.simpleGetter;
// This logs "Super max"
console.log(val);
Here's link to TypeScript playground: Full repro