You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Function Generic is unknown if argument has NoInfer<Generic> but returns the Generic #60922
This, indeed, looks like a simpler version of #60544
I don't quite see how this could be implemented beyond some very basic support for a small set of scenarios. The return type of a function very often depends (even if indirectly) on its parameters types. Like, how would you determine what D should be here?
This, indeed, looks like a simpler version of #60544
I don't quite see how this could be implemented beyond some very basic support for a small set of scenarios. The return type of a function very often depends (even if indirectly) on its parameters types. Like, how would you determine what D should be here?
const signal = linkedSignal({
source: () => 3,
computation: (s) => s
})
Would unknown be a satisfiable inference here? What about this one?
Activity
Andarist commentedon Jan 6, 2025
This, indeed, looks like a simpler version of #60544
I don't quite see how this could be implemented beyond some very basic support for a small set of scenarios. The return type of a function very often depends (even if indirectly) on its parameters types. Like, how would you determine what D should be here?
Would
unknownbe a satisfiable inference here? What about this one?JeanMeche commentedon Jan 6, 2025
I think I get your point.
number | unknownnarrows down tounknown, sounknownis the reseanable inference.typescript-bot commentedon Jan 10, 2025
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
Harpush commentedon Jan 10, 2025
Mateusz Burzyński (@Andarist) Why won't that work though?
Especially as
shas noinfer which means it should infer from the return type that was explicitly given.Andarist commentedon Jan 13, 2025
Harpush this one could work, see: #60964