Skip to content

Implement Null Coalescing and Null Coalescing assignment operators#10636

Merged
daxian-dbw merged 24 commits into
PowerShell:masterfrom
adityapatwardhan:NullAssignment
Oct 17, 2019
Merged

Implement Null Coalescing and Null Coalescing assignment operators#10636
daxian-dbw merged 24 commits into
PowerShell:masterfrom
adityapatwardhan:NullAssignment

Conversation

@adityapatwardhan

@adityapatwardhan adityapatwardhan commented Sep 27, 2019

Copy link
Copy Markdown
Member

PR Summary

Implement the Null Coalescing ?? and Null Coalescing Assignment ??= operators.

PR Context

The operators are discussed in the issue #3240
This PR addresses part of RFC PowerShell/PowerShell-RFC#223

The PR is marked as a Breaking Change due to changes in the TokenFlags enum. The changes were made to include the new TokenFlag - BinaryPrecedenceCoalesce. While making this change, it was also decided to create more space in the BinaryPrecedence section of the enum for future binary operators. The BinaryPrecedenceMask was also changed from 0x07 to 0x0f. The order of precedence is not changed. We expected it can cause a breaking change for binary modules as C# treats enums as constants. Though, it is a breaking change we expect the impact to be pretty low as the usage of precedence token flags should be fairly low.

PR Checklist

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking-Change breaking change that may affect users CL-Engine Indicates that a PR should be marked as an engine change in the Change Log Committee-Reviewed PS-Committee has reviewed this and made a decision

Projects

None yet

Development

Successfully merging this pull request may close these issues.