Skip to content

Commit d04d096

Browse files
authored
Fix test failures in features/semi-auto-props (#61344)
The merge from `main` included a change that removed extra unused diagnostic arguments. But CI run in the merge PR didn't include these tests.
1 parent 550635e commit d04d096

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Compilers/CSharp/Test/Semantic/Semantics/PropertyFieldKeywordTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public class Derived4 : Base
167167
Diagnostic(ErrorCode.ERR_AutoPropertyMustOverrideSet, "P2").WithLocation(17, 25),
168168
// (25,30): error CS8051: Auto-implemented properties must have get accessors.
169169
// public override int P1 { set; }
170-
Diagnostic(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, "set").WithArguments("Derived3.P1.set").WithLocation(25, 30)
170+
Diagnostic(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, "set").WithLocation(25, 30)
171171
);
172172
Assert.Equal(callGetFieldsToEmit ? 5 : 0, accessorBindingData.NumberOfPerformedAccessorBinding);
173173
}
@@ -215,13 +215,13 @@ public interface I
215215
Diagnostic(ErrorCode.ERR_InterfacesCantContainFields, "field").WithLocation(8, 61),
216216
// (10,16): error CS8053: Instance properties in interfaces cannot have initializers.
217217
// public int P4 { get => field; } = 0;
218-
Diagnostic(ErrorCode.ERR_InstancePropertyInitializerInInterface, "P4").WithArguments("I.P4").WithLocation(10, 16),
218+
Diagnostic(ErrorCode.ERR_InstancePropertyInitializerInInterface, "P4").WithLocation(10, 16),
219219
// (10,28): error CS0525: Interfaces cannot contain instance fields
220220
// public int P4 { get => field; } = 0;
221221
Diagnostic(ErrorCode.ERR_InterfacesCantContainFields, "field").WithLocation(10, 28),
222222
// (12,16): error CS8053: Instance properties in interfaces cannot have initializers.
223223
// public int P5 { get => field; set => field = value; } = 0;
224-
Diagnostic(ErrorCode.ERR_InstancePropertyInitializerInInterface, "P5").WithArguments("I.P5").WithLocation(12, 16),
224+
Diagnostic(ErrorCode.ERR_InstancePropertyInitializerInInterface, "P5").WithLocation(12, 16),
225225
// (12,28): error CS0525: Interfaces cannot contain instance fields
226226
// public int P5 { get => field; set => field = value; } = 0;
227227
Diagnostic(ErrorCode.ERR_InterfacesCantContainFields, "field").WithLocation(12, 28),
@@ -230,7 +230,7 @@ public interface I
230230
Diagnostic(ErrorCode.ERR_InterfacesCantContainFields, "field").WithLocation(12, 42),
231231
// (14,16): error CS8053: Instance properties in interfaces cannot have initializers.
232232
// public int P6 { get { _ = field; return field; } set => field = value; } = 0;
233-
Diagnostic(ErrorCode.ERR_InstancePropertyInitializerInInterface, "P6").WithArguments("I.P6").WithLocation(14, 16),
233+
Diagnostic(ErrorCode.ERR_InstancePropertyInitializerInInterface, "P6").WithLocation(14, 16),
234234
// (14,31): error CS0525: Interfaces cannot contain instance fields
235235
// public int P6 { get { _ = field; return field; } set => field = value; } = 0;
236236
Diagnostic(ErrorCode.ERR_InterfacesCantContainFields, "field").WithLocation(14, 31),
@@ -3024,7 +3024,7 @@ class C
30243024
comp.VerifyDiagnostics(
30253025
// (4,21): error CS8051: Auto-implemented properties must have get accessors.
30263026
// public int P1 { set; }
3027-
Diagnostic(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, "set").WithArguments("C.P1.set").WithLocation(4, 21)
3027+
Diagnostic(ErrorCode.ERR_AutoPropertyMustHaveGetAccessor, "set").WithLocation(4, 21)
30283028
);
30293029
Assert.Equal(0, accessorBindingData.NumberOfPerformedAccessorBinding);
30303030
}

src/Compilers/CSharp/Test/Semantic/Semantics/UninitializedNonNullableFieldTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2633,7 +2633,7 @@ public C()
26332633
Diagnostic(ErrorCode.ERR_PropertyWithNoAccessors, "P").WithArguments("C.P").WithLocation(5, 19),
26342634
// (7,19): error CS8050: Only auto-implemented properties can have initializers.
26352635
// public string P3 { } = string.Empty;
2636-
Diagnostic(ErrorCode.ERR_InitializerOnNonAutoProperty, "P3").WithArguments("C.P3").WithLocation(7, 19),
2636+
Diagnostic(ErrorCode.ERR_InitializerOnNonAutoProperty, "P3").WithLocation(7, 19),
26372637
// (7,19): error CS0548: 'C.P3': property or indexer must have at least one accessor
26382638
// public string P3 { } = string.Empty;
26392639
Diagnostic(ErrorCode.ERR_PropertyWithNoAccessors, "P3").WithArguments("C.P3").WithLocation(7, 19),

0 commit comments

Comments
 (0)