Skip to content

Commit

Permalink
Trigger formatting issue with raw strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jcouv committed Apr 8, 2022
1 parent 9c9cf66 commit 147f247
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3133,12 +3133,12 @@ public void RefAssignment_Foreach()

void verify(string variableType, string itemType, params DiagnosticDescription[] expected)
{
var source = @"
var source = $$"""
class C<T>
{
void M(RefEnumerable collection)
{
foreach (ref VARTYPE item in collection)
foreach (ref {{variableType}} item in collection)
{
item.ToString();
}
Expand All @@ -3149,13 +3149,14 @@ class RefEnumerable
public StructEnum GetEnumerator() => throw null!;
public struct StructEnum
{
public ref ITEMTYPE Current => throw null!;
public ref {{itemType}} Current => throw null!;
public bool MoveNext() => throw null!;
}
}
}";
}
""";

var comp = CreateCompilation(source.Replace("VARTYPE", variableType).Replace("ITEMTYPE", itemType), options: WithNullableEnable());
var comp = CreateCompilation(source, options: WithNullableEnable());
comp.VerifyDiagnostics(expected);
}
}
Expand Down

0 comments on commit 147f247

Please sign in to comment.