Skip to content

Commit

Permalink
Inline check
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Oct 12, 2021
1 parent 71b5b2d commit e22c1a1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ internal partial class Binder
private BoundExpression BindInterpolatedString(InterpolatedStringExpressionSyntax node, BindingDiagnosticBag diagnostics)
{
var startText = node.StringStartToken.Text;
if (startText.StartsWith("@$\""))
if (startText.StartsWith("@$\"") && !Compilation.IsFeatureEnabled(MessageID.IDS_FeatureAltInterpolatedVerbatimStrings))
{
CheckFeatureAvailability(node, MessageID.IDS_FeatureAltInterpolatedVerbatimStrings, diagnostics, node.StringStartToken.GetLocation());
Error(diagnostics,
ErrorCode.ERR_AltInterpolatedVerbatimStringsNotAvailable,
node.StringStartToken.GetLocation(),
new CSharpRequiredLanguageVersion(MessageID.IDS_FeatureAltInterpolatedVerbatimStrings.RequiredVersion()));
}

var builder = ArrayBuilder<BoundExpression>.GetInstance();
Expand Down

0 comments on commit e22c1a1

Please sign in to comment.