Skip to content

Conversation

@a-tarasyuk
Copy link
Contributor

Fixes #44448

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Jun 16, 2021
@DanielRosenwasser
Copy link
Member

You may need to rewrite a few tests since this option is going to be renamed and removed from --strict.

@a-tarasyuk
Copy link
Contributor Author

@DanielRosenwasser Do you mean to use strictOptionalProperties in order to fix it after rename?

@DanielRosenwasser
Copy link
Member

Yeah, and tests that assume strict will toggle the option will change in their behavior.

@a-tarasyuk a-tarasyuk force-pushed the fix/44448 branch 3 times, most recently from 6d28cae to 6d17d21 Compare June 18, 2021 13:05
@a-tarasyuk a-tarasyuk changed the title fix(44448): Non-optional but undefined delete under strictOptionalProperties fix(44448): Non-optional but undefined delete under exactOptionalPropertyTypes Jun 18, 2021
@a-tarasyuk a-tarasyuk force-pushed the fix/44448 branch 2 times, most recently from 75d0dd5 to 6744cba Compare June 18, 2021 18:20
@DanielRosenwasser DanielRosenwasser merged commit 5c8d763 into microsoft:main Jun 29, 2021
@mtreder
Copy link

mtreder commented Jun 30, 2021

I expected the following to be correct code, but it is generating an error:

declare const obj: {definitelyHereMaybeUndefined?: number};

delete obj.definitelyHereMaybeUndefined;

Playground Example

EDIT: The copied link doesn't seem to preserve the exactOptionalPropertyTypes flag.

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-optional but undefined delete under strictOptionalProperties

5 participants