TypeScript is not able to infer the type narrowing from method #44591
Labels
Out of Scope
This idea sits outside of the TypeScript language design constraints
Suggestion
An idea for TypeScript
Bug Report
🔎 Search Terms
Type narrowing
🕗 Version & Regression Information
TS - 4.3.2
(Regression not aware)
💻 Code
🙁 Actual behavior
When using method getting error.
Argument of type 'string | number | null' is not assignable to parameter of type 'string | number'.
while same thing is working when using variable directly.🙂 Expected behavior
Narrowing should work whether we use method or property.
The text was updated successfully, but these errors were encountered: