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..78b54a2b7481e 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs @@ -3133,12 +3133,12 @@ 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 +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); } }