Commit 30128dd
Add language version check for compound assignment null propagation
Compound assignments with null conditional (?.) are only supported in C# 14+.
Added language version check to ensure the diagnostic is only offered when supported.
Added test to verify diagnostic is not offered for C# 13.
Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>1 parent 692ad0d commit 30128dd
File tree
2 files changed
+20
-1
lines changed- src/Analyzers
- CSharp/Tests/UseNullPropagation
- Core/Analyzers/UseNullPropagation
2 files changed
+20
-1
lines changedLines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3006 | 3006 | | |
3007 | 3007 | | |
3008 | 3008 | | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
3009 | 3027 | | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
451 | 452 | | |
452 | | - | |
| 453 | + | |
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
| |||
0 commit comments