Skip to content

Commit 53bbf4c

Browse files
Copilottarekgh
andcommitted
Fix all array index patterns in NetFX baseline comprehensively
The previous fix only handled {count} but missed variations like {count++}. This comprehensive fix removes model name prefixes from all array index patterns regardless of the expression used (e.g., "FirstModel.P4[{count++}]" becomes "P4[{count++}]"). This ensures all enumeration validation patterns are correctly updated to match the generator output. Co-authored-by: tarekgh <[email protected]>
1 parent 893613f commit 53bbf4c

File tree

1 file changed

+1
-1
lines changed
  • src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/Baselines/NetFX

1 file changed

+1
-1
lines changed

src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/Baselines/NetFX/Validators.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ partial struct FirstValidator
296296
var count = 0;
297297
foreach (var o in options.P4)
298298
{
299-
(builder ??= new()).AddResult(global::Enumeration.__ThirdModelValidator__.Validate(string.IsNullOrEmpty(name) ? $"FirstModel.P4[{count++}] is null" : $"{name}.P4[{count++}] is null", o));
299+
(builder ??= new()).AddResult(global::Enumeration.__ThirdModelValidator__.Validate(string.IsNullOrEmpty(name) ? $"P4[{count++}] is null" : $"{name}.P4[{count++}] is null", o));
300300
}
301301
}
302302

0 commit comments

Comments
 (0)