Cannot narrow the optional properties to T
properly through (T | undefined) => T
if --strictOptionalProperties=true
#44388
Labels
Milestone
Bug Report
🔎 Search Terms
--strictOptionalProperties
, Strict optional properties🕗 Version & Regression Information
[email protected]
.[email protected]
and[email protected]
--strictOptionalProperties=false
. But I could not think this is reasonable behavior.⏯ Playground Link
Playground link with relevant code
At this moment which I filed this issue, typescript playground does not prepare to use
4.4.0-dev.20210602
.💻 Code
🙁 Actual behavior
The above code will be compile error as I commented.
🙂 Expected behavior
notUndefinedVal
asnumber
.strictOptionalProperties
and this behavior is not reasonable....or are there any workaround?
The text was updated successfully, but these errors were encountered: