ts-transformer-properties-rename icon indicating copy to clipboard operation
ts-transformer-properties-rename copied to clipboard

Fixed handling unnamed/undeclared returned type from functions

Open timocov opened this issue 3 years ago • 2 comments

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 avatar Jan 02 '22 18:01 timocov

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

timocov avatar Jan 18 '22 16:01 timocov

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.

timocov avatar Jan 18 '22 16:01 timocov