Bug 45286

Summary: C# string interpolation line does not compile on OSX but does on MSBuild
Product: [Mono] Compilers Reporter: Ed Giardina <ed>
Component: C#Assignee: Marek Safar <masafa>
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Tags: Is this bug a regression?: ---
Last known good build:

Description Ed Giardina 2016-10-11 18:12:27 UTC
Description of Problem:

I've got some string interpolation code that compiles in MSBuild on Windows but not on Mac OSX Sierra

public static string SanitizeCsv(string field)
            return string.IsNullOrEmpty(field)
              ? string.Empty
              : $"\"{field.Replace("\"", "\\\"").Replace("\n", "\\n")}\"";

Steps to reproduce the problem:
1. Author the above function
2. Code will fail to build

Actual Results:
Return compiler error on the : $" line with
Error CS8076: Missing close delimiter `}' for interpolated expression (CS8076) (Core)

Expected Results:
Code to compile

How often does this happen? 
Every build

Additional Information:
Mono JIT compiler version 4.6.1
Xamarin Studio Community 6.1.1 build 15
Comment 1 Marek Safar 2016-10-12 15:37:22 UTC
Fixed in master and Mono 4.8
Comment 2 Ed Giardina 2016-10-12 15:49:30 UTC
Thank you Marek, the turnaround time was amazing! Litmus owes you a beer if you are ever in the Boston area!