Skip to content

VB -> C#: Add brackets for null coalesce operator when needed#628

Merged
GrahamTheCoder merged 3 commits into
icsharpcode:masterfrom
SuperRembo:626
Sep 13, 2020
Merged

VB -> C#: Add brackets for null coalesce operator when needed#628
GrahamTheCoder merged 3 commits into
icsharpcode:masterfrom
SuperRembo:626

Conversation

@SuperRembo

Copy link
Copy Markdown
Contributor

Fixes #626

Problem

In some cases the null coalesce operator is missing parenthesis, resulting in incorrect output.

Solution

  • The same mechanism is used as already exists for the ternary operator
  • Covered by test NullCoalescingOperatorUsesParenthesisWhenNeededAsync

@GrahamTheCoder
GrahamTheCoder merged commit c0a07dd into icsharpcode:master Sep 13, 2020
@GrahamTheCoder

Copy link
Copy Markdown
Member

Looks great, thanks!

@SuperRembo
SuperRembo deleted the 626 branch September 14, 2020 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VB -> C#: Null coalesce missing brackets

2 participants