Skip to content

Fixed handling unnamed/undeclared returned type from functions#28

Open
timocov wants to merge 1 commit into
masterfrom
fix27-handle-unnamed-returned-type
Open

Fixed handling unnamed/undeclared returned type from functions#28
timocov wants to merge 1 commit into
masterfrom
fix27-handle-unnamed-returned-type

Conversation

@timocov
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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