--- /dev/null
+// CS1644: Feature `interpolated strings' cannot be used because it is not part of the C# 5.0 language specification
+// Line: 9
+// Compiler options: -langversion:5
+
+public class Program
+{
+ public static void Main()
+ {
+ var x = $"I should not compile";
+ }
+}
interpolated_string
: INTERPOLATED_STRING interpolations INTERPOLATED_STRING_END
{
+ if (lang_version < LanguageVersion.V_6)
+ FeatureIsNotAvailable (GetLocation ($1), "interpolated strings");
+
$$ = new InterpolatedString ((StringLiteral) $1, (List<Expression>) $2, (StringLiteral) $3);
}
| INTERPOLATED_STRING_END
{
+ if (lang_version < LanguageVersion.V_6)
+ FeatureIsNotAvailable (GetLocation ($1), "interpolated strings");
+
$$ = new InterpolatedString ((StringLiteral) $1, null, null);
}
;