Default generic types are unused in ReturnType
#48870
Labels
Working as Intended
The behavior described is the intended behavior; this is not a bug
Bug Report
🔎 Search Terms
generic
,default
,unknown
,infer
#48480 looked similar, but it was talking about the type of a function parameter's default value not being inferred, whereas this ticket is about a generic parameter with a default type not being used by
infer
.🕗 Version & Regression Information
I tested against v4.4.4, 4.6.3, and
nightly
.⏯ Playground Link
Playground link
💻 Code
🙁 Actual vs Expected behaviour
I expect the type of
myFuncReturnType
to bereadonly [number, string]
, but it's actuallyreadonly [unknown, unknown]
, because the default generic type was not used.The text was updated successfully, but these errors were encountered: