@@ -167,7 +167,7 @@ public class Derived4 : Base
167
167
Diagnostic ( ErrorCode . ERR_AutoPropertyMustOverrideSet , "P2" ) . WithLocation ( 17 , 25 ) ,
168
168
// (25,30): error CS8051: Auto-implemented properties must have get accessors.
169
169
// 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 )
171
171
) ;
172
172
Assert . Equal ( callGetFieldsToEmit ? 5 : 0 , accessorBindingData . NumberOfPerformedAccessorBinding ) ;
173
173
}
@@ -215,13 +215,13 @@ public interface I
215
215
Diagnostic ( ErrorCode . ERR_InterfacesCantContainFields , "field" ) . WithLocation ( 8 , 61 ) ,
216
216
// (10,16): error CS8053: Instance properties in interfaces cannot have initializers.
217
217
// 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 ) ,
219
219
// (10,28): error CS0525: Interfaces cannot contain instance fields
220
220
// public int P4 { get => field; } = 0;
221
221
Diagnostic ( ErrorCode . ERR_InterfacesCantContainFields , "field" ) . WithLocation ( 10 , 28 ) ,
222
222
// (12,16): error CS8053: Instance properties in interfaces cannot have initializers.
223
223
// 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 ) ,
225
225
// (12,28): error CS0525: Interfaces cannot contain instance fields
226
226
// public int P5 { get => field; set => field = value; } = 0;
227
227
Diagnostic ( ErrorCode . ERR_InterfacesCantContainFields , "field" ) . WithLocation ( 12 , 28 ) ,
@@ -230,7 +230,7 @@ public interface I
230
230
Diagnostic ( ErrorCode . ERR_InterfacesCantContainFields , "field" ) . WithLocation ( 12 , 42 ) ,
231
231
// (14,16): error CS8053: Instance properties in interfaces cannot have initializers.
232
232
// 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 ) ,
234
234
// (14,31): error CS0525: Interfaces cannot contain instance fields
235
235
// public int P6 { get { _ = field; return field; } set => field = value; } = 0;
236
236
Diagnostic ( ErrorCode . ERR_InterfacesCantContainFields , "field" ) . WithLocation ( 14 , 31 ) ,
@@ -3024,7 +3024,7 @@ class C
3024
3024
comp . VerifyDiagnostics (
3025
3025
// (4,21): error CS8051: Auto-implemented properties must have get accessors.
3026
3026
// 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 )
3028
3028
) ;
3029
3029
Assert . Equal ( 0 , accessorBindingData . NumberOfPerformedAccessorBinding ) ;
3030
3030
}
0 commit comments