@@ -52,7 +52,7 @@ public async Task TestStringInterpolationAsync()
5252{
5353 public class TestClass
5454 {
55- public void TestMethod()
55+ public void TestMethod(int a, int b )
5656 {
5757 var test = 2;
5858 var x = $""{test}"";
@@ -61,6 +61,8 @@ public void TestMethod()
6161 x = $""({test} )"";
6262 x = $""{test {|#0:}|}"";
6363 x = $""{test {|#1:}|} "";
64+ x = $""{new { a, b{|#2:}|}}"";
65+ x = $""{new { a, b } {|#3:}|}"";
6466 }
6567 }
6668}
@@ -70,7 +72,7 @@ public void TestMethod()
7072{
7173 public class TestClass
7274 {
73- public void TestMethod()
75+ public void TestMethod(int a, int b )
7476 {
7577 var test = 2;
7678 var x = $""{test}"";
@@ -79,6 +81,8 @@ public void TestMethod()
7981 x = $""({test} )"";
8082 x = $""{test}"";
8183 x = $""{test} "";
84+ x = $""{new { a, b }}"";
85+ x = $""{new { a, b }}"";
8286 }
8387 }
8488}
@@ -88,6 +92,8 @@ public void TestMethod()
8892 {
8993 Diagnostic ( ) . WithLocation ( 0 ) . WithArguments ( " not" , "preceded" ) ,
9094 Diagnostic ( ) . WithLocation ( 1 ) . WithArguments ( " not" , "preceded" ) ,
95+ Diagnostic ( ) . WithLocation ( 2 ) . WithArguments ( string . Empty , "preceded" ) ,
96+ Diagnostic ( ) . WithLocation ( 3 ) . WithArguments ( " not" , "preceded" ) ,
9197 } ;
9298
9399 await VerifyCSharpFixAsync ( testCode , expected , fixedCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
0 commit comments