From a6c03db846c0d63e397d833e620ba2ebb5d52546 Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Fri, 8 Apr 2022 13:42:15 -0700 Subject: [PATCH 1/2] Trigger formatting issue with raw strings --- eng/Versions.props | 2 +- .../Semantics/NullableReferenceTypesTests.cs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 2cd9897b4ab0b..f9a86674605fb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -24,7 +24,7 @@ 1.1.2-beta1.22122.4 0.1.132-beta - 4.1.0 + 4.2.0-2.final 17.2.178-preview 17.2.140-preview-ga1e1777dca 5.0.0-alpha1.19409.1 diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs index caaadc4583465..7c0665475b361 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs @@ -3133,12 +3133,13 @@ public void RefAssignment_Foreach() void verify(string variableType, string itemType, params DiagnosticDescription[] expected) { - var source = @" + var source = $$""" + class C { void M(RefEnumerable collection) { - foreach (ref VARTYPE item in collection) + foreach (ref {{variableType}} item in collection) { item.ToString(); } @@ -3149,13 +3150,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); } } From 2a435463b0d73fa4595a33a0e7a1524c9f1d36dc Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Sun, 10 Apr 2022 18:33:32 -0700 Subject: [PATCH 2/2] Update dotnet-format version --- dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet-tools.json b/dotnet-tools.json index b8d5a0aada491..447b894f9dc94 100644 --- a/dotnet-tools.json +++ b/dotnet-tools.json @@ -2,7 +2,7 @@ "isRoot": true, "tools": { "dotnet-format": { - "version": "6.2.315104", + "version": "6.3.317301", "commands": [ "dotnet-format" ]