[next/nightly] Incorrect _'obj.prop' is possibly 'undefined'._ Error in CFA with exactOptionalPropertyTypes
and Optional-never
Properties
#55566
Labels
Bug
A bug in TypeScript
Milestone
π Search Terms
exactOptionalPropertyTypes
π Version & Regression Information
typescript@5.2
andtypescript@5.3.0-dev.20230816
(still happening intypescript@5.3.0-dev.20230825
)β― Playground Link
https://www.typescriptlang.org/play?exactOptionalPropertyTypes=true&ts=5.3.0-dev.20230825#code/KYDwDg9gTgLgBAMwK4DsDGMCWEVwLYCGmKAFAQFxwDOMUxA5gNoC6cAPnKgCbALHBcAlHADeAWABQcaXDQ4acAF5wAvHAJwA9Jsky9cAPyj1cAL6790yiLgAjSowBEMABbAowR61MBuSRelFADoNbQD9I2CCIJgIAGVaBhJBcL1KYNsY+MSUemSfLU04GCoAAQBWIIBmOHcoaDgcOAADDOa4Nw84AHc3XGbQAgwAeTAsHAIAGwAFerB3GABPABVF+ap2zCpalAJbSYF-KRltHugAawBaAnruOABiAEZwuRQFRQB1C4BBW5QuazqSg0Oi5FgAGjsBko3F4-C4ZnYxns1ByTGYkII0M4-zhKAEiLUij8x0CXyg51+EG4IUKqRkkXJlL+XBCWQSoLyKVJ+nSTKpNMysQ5SUEJPCp26F2uLIeACZwo4CI44MQlIVii4tqrtgAqXXDAByABkAJr6kwANymmARUopN2p-x6fRagxGY2wuxmcwWKzWwA2cH1AEk4hbgLt9oceXpImzhWjkvSrEogkLspz8pJzBIgA
π» Code
π Actual behavior
Errors in code
'z.b' is possibly 'undefined'.
π Expected behavior
Try any pervious version (I checked back to
typescript@4.0
) and the CFA from the!!z.a
branch works fine.Additional information about the issue
An interesting little problem/tidbit back to
typescript@4.4
is this IntelliSense:Why is
a
optional in the"a" in zWorkaround2
branch?The text was updated successfully, but these errors were encountered: