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 ed8fe19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<MicrosoftCodeAnalysisTestingVersion>1.1.2-beta1.22122.4</MicrosoftCodeAnalysisTestingVersion>
<MicrosoftVisualStudioExtensibilityTestingVersion>0.1.132-beta</MicrosoftVisualStudioExtensibilityTestingVersion>
<!-- CodeStyleAnalyzerVersion should we updated together with version of dotnet-format in dotnet-tools.json -->
<CodeStyleAnalyzerVersion>4.1.0</CodeStyleAnalyzerVersion>
<CodeStyleAnalyzerVersion>4.2.0-2.final</CodeStyleAnalyzerVersion>
<VisualStudioEditorPackagesVersion>17.2.178-preview</VisualStudioEditorPackagesVersion>
<VisualStudioEditorNewPackagesVersion>17.2.140-preview-ga1e1777dca</VisualStudioEditorNewPackagesVersion>
<ILAsmPackageVersion>5.0.0-alpha1.19409.1</ILAsmPackageVersion>
Expand Down
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 ed8fe19

Please sign in to comment.