File tree Expand file tree Collapse file tree
PropertyChangedAnalyzers.Test
INPC014PreferSettingBackingFieldInCtor
INPC015PropertyIsRecursive Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ public class C
237237
238238 public C(int value)
239239 {
240+ #pragma warning disable CS0219
240241 var p = 1;
241242 ↓this.P = value;
242243 }
@@ -258,6 +259,7 @@ public class C
258259
259260 public C(int value)
260261 {
262+ #pragma warning disable CS0219
261263 var p = 1;
262264 this.p = value;
263265 }
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ namespace N
247247
248248 public class C : INotifyPropertyChanged
249249 {
250- private string p;
250+ private string? p;
251251
252252 public event PropertyChangedEventHandler? PropertyChanged;
253253
@@ -256,7 +256,7 @@ public C(string p)
256256 this.PropertyChanged += (_, __) => this.P = p;
257257 }
258258
259- public string P
259+ public string? P
260260 {
261261 get => this.p;
262262 private set
@@ -291,18 +291,18 @@ namespace N
291291
292292 public class C : INotifyPropertyChanged
293293 {
294- private string p;
294+ private string? p;
295295
296296 public event PropertyChangedEventHandler? PropertyChanged;
297297
298298 public C(string p)
299299 {
300- void OnChanged(object _, PropertyChangedEventArgs __) => this.P = p;
300+ void OnChanged(object? _, PropertyChangedEventArgs __) => this.P = p;
301301
302302 this.PropertyChanged += OnChanged;
303303 }
304304
305- public string P
305+ public string? P
306306 {
307307 get => this.p;
308308 private set
Original file line number Diff line number Diff line change 1- namespace PropertyChangedAnalyzers . Test . INPC015PropertyIsRecursive
1+ namespace PropertyChangedAnalyzers . Test . INPC015PropertyIsRecursive
22{
33 using Gu . Roslyn . Asserts ;
44 using NUnit . Framework ;
@@ -67,7 +67,7 @@ namespace N
6767{
6868 public class C
6969 {
70- private int p;
70+ private int p = 1 ;
7171
7272 public int P
7373 {
@@ -88,7 +88,7 @@ namespace N
8888{
8989 public class C
9090 {
91- private int p;
91+ private int p = 1 ;
9292
9393 public int P
9494 {
You can’t perform that action at this time.
0 commit comments