Skip to content
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

Bug: Magically infer the return data type of a function is not working correctly. #551

Open
5 tasks done
fab1o opened this issue Sep 16, 2019 · 0 comments
Open
5 tasks done

Comments

@fab1o
Copy link

fab1o commented Sep 16, 2019

Make sure these boxes are checked before submitting your issue - thank you!
(If your issue is neither a both bug nor a request, please write in a free style)

Short summary of your issue

I have a function that ESDoc tries to infer the data type it returns, but it does so incorrectly.

Input data for reproducing

Codes

    function example(args) {
        const errorMessage = {
            get args() {
                return 'args should be valid';
            }
        };

        if (args == null) {
            throw Error(errorMessage.args);
        }

        // ....
    }

Output data

It produces documentation with the wrong data type as the return value from the example function. The example function as you can see above, returns undefined

but ESDocs says it returns string because it's inferring it wrongly.

Your environment

  • OS type and version: Mac
  • Node.js version: v10.16.3
  • ESDoc version: v1.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant