Fixed VS2017 crash with :: operator#23946
Conversation
|
|
||
| if (node is AliasQualifiedNameSyntax aliasQualifiedName && aliasQualifiedName.Name != null) | ||
| { | ||
| return aliasQualifiedName.Name; |
There was a problem hiding this comment.
If this fixes a crash, then it seems like that would be because returning null below causes a problem. Which means the caller of this method shoul dbe updated to be resilient to getting null back, as that's part of the contract of this method.
There was a problem hiding this comment.
Good point, thanks!
There was a problem hiding this comment.
@zaytsev-victor Should we undo this change then, since the change in NameSyntaxClassifier.cs is the right one?
There was a problem hiding this comment.
@jasonmalinowski No, we should not undo this change, because this is the fix. Without this change
Col::List would not be recognized that List is the type.
There was a problem hiding this comment.
Consider renamign this method to TryGetRightmostName. That will allow us to audit all the callers.
jasonmalinowski
left a comment
There was a problem hiding this comment.
Now that we have the correct fix, we can delete the unnecessary code.
|
@Pilchie for ask mode |
|
Needs passing tests. |
|
Approved for 15.6 Preview 4 (pending passing tests) |
Customer scenario
A customer attempts to use the alias qualification operator
::to refer to a namespace.Bugs this fixes
Fixes #23940
Workarounds, if any
Avoid using this syntax.
Risk
Low.
Performance impact
Negligible. Adds a type check that is only needed in this case.
Is this a regression from a previous update?
No.
Root cause analysis
No one considered this syntax in testing. @sharwell wasn't even aware it was valid.
How was the bug found?
Reported via developer community.
Test documentation updated?
No.