Constrain availability of ref conditional expressions to language versions 7.2 and higher#24355
Merged
VSadov merged 1 commit intodotnet:dev15.6.xfrom Jan 22, 2018
Merged
Conversation
jaredpar
approved these changes
Jan 20, 2018
…rsions 7.2 and higher Fixes:dotnet#24306
4f213dc to
91fa14d
Compare
Member
Author
|
@dotnet/roslyn-compiler - please review! This is for 15.6.x . |
jcouv
reviewed
Jan 20, 2018
| int local2 = 2; | ||
| bool b = true; | ||
|
|
||
| ref int r = ref b? ref local1: ref local2; |
jcouv
approved these changes
Jan 20, 2018
Member
Author
|
CC @MeiChin-Tsai for ask mode approval |
|
approved. |
Member
Author
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Constrains availability of ref conditional expressions to language versions 7.2 and higher
Fixes:#24306
Customer scenario
Customer uses the new feature
ref conditional expressionin a project not yet upgraded to C# 7.2Let's say the team of developers has not yet completely moved to the new version of the compiler and compiling with older toolset is still a scenario.
It is expected to see errors about insufficient version for the feature used, but the error is not given.
As a result the project is no longer compatible with an older versions of the compiler defeating the purpose of the language version restriction.
Bugs this fixes
#24306
Workarounds, if any
Customer must know to not use the feature if compiling with older toolsets is still important.
Risk
Very low.
The feature is very new and is generally used in combination with other features predicated on 7.2
Performance impact
None.
The fix merely adds a language version check.
Is this a regression from a previous update?
N/A
Root cause analysis
The feature was prototyped in a separate branch - before the version 7.2 was available and could be checked for.
In addition the feature did not introduce any new syntax nodes, which would typically trigger adding a version check.
How was the bug found?
Customer reported.
Test documentation updated?
N/A