-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Function Generic is unknown
if argument has NoInfer<Generic>
but returns the Generic
#60922
Comments
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 const signal = linkedSignal({
source: () => 3,
computation: (s) => {
return Math.random() > 0.5 > 1 : s;
}
}) |
I think I get your point.
|
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
@Andarist Why won't that work though? const signal = linkedSignal({
source: () => 3,
computation: (s): number => {
return Math.random() > 0.5 > 1 : s;
}
}) Especially as |
π Search Terms
π Version & Regression Information
Still the case in the latest 5.7.2.
β― Playground Link
https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBAE2AYwDYEMrDgMwK4B2yMAlhAXKiQQNbAIDKJA5geqgDwMA0cAIgD4AFBDClyAZwBccAN4AoOErgSIeKMmAyhASjgBeAXAYBuRcuQQAtmDwx04gttXrNMgHIQAkgRzAoHIJ6hvxmAL46Mnxm8pYEEvASLGyoBpTUdIzJ7EIKyipqGlpwugZGAMzc5kqWNnYOZE4lEsEVcPIR8vJAA
π» Code
π Actual behavior
signal
isunknown
π Expected behavior
signal
isnumber
Additional information about the issue
I wasn't sure, but it could be a duplicate of #60544.
The text was updated successfully, but these errors were encountered: