diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs
index 07c57169ff8abf6bfdf03e16aa0b5edd77f4e24d..33f466bd9ffec92e51f9cd554db8f174899dc43a 100644
--- a/src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs
+++ b/src/Compilers/CSharp/Portable/Binder/Binder_Operators.cs
@@ -3521,6 +3521,10 @@ private BoundExpression BindConditionalOperator(ConditionalExpressionSyntax node
diagnostics.Add(ErrorCode.ERR_RefConditionalNeedsTwoRefs, whenTrue.GetFirstToken().GetLocation());
}
}
+ else
+ {
+ CheckFeatureAvailability(node, MessageID.IDS_FeatureRefConditional, diagnostics);
+ }
BoundExpression condition = BindBooleanExpression(node.Condition, diagnostics);
diff --git a/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs b/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
index ff90d85491af95c82e755856e85a9d83124dba45..2010878cbe3e15b36e0e225f3fac21b7be89273c 100644
--- a/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
+++ b/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
@@ -10700,6 +10700,15 @@ internal class CSharpResources {
}
}
+ ///
+ /// Looks up a localized string similar to ref conditional expression.
+ ///
+ internal static string IDS_FeatureRefConditional {
+ get {
+ return ResourceManager.GetString("IDS_FeatureRefConditional", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to ref extension methods.
///
diff --git a/src/Compilers/CSharp/Portable/CSharpResources.resx b/src/Compilers/CSharp/Portable/CSharpResources.resx
index a4e5cbf510350edaf152dc74932ce3f10e9d036d..b0d3343e7660d6de6e61f74c61e5087d918af1dd 100644
--- a/src/Compilers/CSharp/Portable/CSharpResources.resx
+++ b/src/Compilers/CSharp/Portable/CSharpResources.resx
@@ -4264,6 +4264,9 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
ref structs
+
+ ref conditional expression
+
Compilation (C#):
diff --git a/src/Compilers/CSharp/Portable/Errors/MessageID.cs b/src/Compilers/CSharp/Portable/Errors/MessageID.cs
index 935a0f2d0495b96e7fc49dd4215e07a5c9086557..6d16f1c290da340ff041b659270f2ad5608316d8 100644
--- a/src/Compilers/CSharp/Portable/Errors/MessageID.cs
+++ b/src/Compilers/CSharp/Portable/Errors/MessageID.cs
@@ -145,6 +145,7 @@ internal enum MessageID
IDS_FeatureRefExtensionMethods = MessageBase + 12728,
IDS_StackAllocExpression = MessageBase + 12729,
IDS_FeaturePrivateProtected = MessageBase + 12730,
+ IDS_FeatureRefConditional = MessageBase + 12731,
}
// Message IDs may refer to strings that need to be localized.
@@ -192,6 +193,7 @@ internal static LanguageVersion RequiredVersion(this MessageID feature)
case MessageID.IDS_FeatureRefStructs:
case MessageID.IDS_FeatureReadOnlyStructs:
case MessageID.IDS_FeatureRefExtensionMethods:
+ case MessageID.IDS_FeatureRefConditional:
return LanguageVersion.CSharp7_2;
// C# 7.1 features.
diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
index 834382efc0165facc82fe9ef8753f9a75e18a93e..6374f21b666a117053d0e7b5a51f236f4439c034 100644
--- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
+++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
@@ -8590,6 +8590,11 @@ Pokud chcete odstranit toto varování, můžete místo toho použít /reference
Arguments with 'in' modifier cannot be used in dynamically dispatched expessions.
+
+
+ ref conditional expression
+
+