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

Set explicit void return type in function builder if set by the user #24

Open
Legion2 opened this issue Jul 24, 2023 · 2 comments · May be fixed by #25
Open

Set explicit void return type in function builder if set by the user #24

Legion2 opened this issue Jul 24, 2023 · 2 comments · May be fixed by #25

Comments

@Legion2
Copy link

Legion2 commented Jul 24, 2023

When the return type is explicitly set to void it should also be set in the generated code explicitly to void. When enabling strict type checking in typescript compiler with the noImplicitAny option, all functions without explicit return type default to any.
Following code must be changed:

if (returnType != null && returnType != TypeName.VOID) {
codeWriter.emitCode(CodeBlock.of(": %T", returnType))
}

@kdubb
Copy link
Contributor

kdubb commented Jul 25, 2023

Agreed.

@Legion2 Legion2 linked a pull request Jul 25, 2023 that will close this issue
@Legion2
Copy link
Author

Legion2 commented Jul 25, 2023

I created #25

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

Successfully merging a pull request may close this issue.

2 participants