Closed
Description
Looks that the "declare a namespace with a function inside and expand the function with expando assignments" workaround for my "JS namespaces" stopped working in TS 4.5
💻 Code
declare namespace app {
function foo(): void;
}
app.foo.bar = (function () {
const someFun = (arg: number) => {};
return { someFun };
})();
app.foo.bar.someFun(1);
This works in 4.4.2.
This doesn't work in 4.5.5
🙁 Actual behavior
Compiler error:
Function 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.
🙂 Expected behavior
No error with proper inference.