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

Fixed handling unnamed/undeclared returned type from functions #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timocov
Copy link
Owner

@timocov timocov commented Jan 2, 2022

This changes almost fix #27 for now (currently I have no idea how to handle specified unnamed returned typed so I've asked for help in TypeScript discord https://discord.com/channels/508357248330760243/640177429775777792/927239241459724298).

@timocov
Copy link
Owner Author

timocov commented Jan 18, 2022

The response: https://discord.com/channels/508357248330760243/640177429775777792/933032112909586452 (vscode/ts uses checker.isTypeAssignableTo to detect this).

@timocov
Copy link
Owner Author

timocov commented Jan 18, 2022

Based on the answer, it seems that to check this we need to compare unnamed object's type with every publicly accessible type, which might and will break the code because it is quite possible that 2 types might be assigned to each other and they will be unrelated.

Probably it is worth to leave it as is right now and say that this is expected behaviour that we don't handle it and you need to specify types explicitly everywhere if needed.

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 this pull request may close these issues.

Return type of public function is marked as internal
1 participant