-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Errors in curried function with overloads in JsDoc #49708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
@MartinJohns it already works in pure TypeScript like I said in OP. So I am not sure why your link matters to my issue. I am asking about an error which occurs in JsDoc but which doesn't happen in TypeScript. |
It does not: Playground link |
OK, I didn't want to make my question about arrow functions in the first place, but about how I can solve, if at all, my problem, which consists of typing the function in JsDoc, because it seems to work in pure TyperScript: function bar(init: "a"): () => string;
function bar(init: "b"): () => number;
function bar(init: any): any {
return () => {
switch (init) {
case "a":
return "abc";
case "b":
return 10;
default:
throw Error("Invalid body method.");
}
};
} |
JSDoc currently does not support to document overloads in functions, see #25590. |
Thank you! |
The following function with overloads with JsDoc throws two errors. Written in pure TypeScript it passes the compiler. Is there a way to do this in JsDoc?
If there is no way, can I expect a fix in the future maybe or is it just technically impossible at the moment?
Thanks!
The text was updated successfully, but these errors were encountered: