@@ -66,7 +66,7 @@ public partial class ExternalType : IEquatable<ExternalType>
6666
6767 var externalCompilation = CSharpCompilation . Create (
6868 "ExternalLib" ,
69- new [ ] { CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
69+ [ CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
7070 CoreReferences ,
7171 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
7272
@@ -97,7 +97,7 @@ public partial class Container
9797
9898 var mainCompilation = CSharpCompilation . Create (
9999 "MainApp" ,
100- new [ ] { CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
100+ [ CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
101101 mainReferences ,
102102 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
103103
@@ -153,7 +153,7 @@ public partial class ExternalType : IEquatable<ExternalType>
153153
154154 var externalCompilation = CSharpCompilation . Create (
155155 "ExternalLib" ,
156- new [ ] { CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
156+ [ CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
157157 CoreReferences ,
158158 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
159159
@@ -176,14 +176,14 @@ public partial class Container
176176
177177 var mainCompilation = CSharpCompilation . Create (
178178 "MainApp" ,
179- new [ ] { CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
179+ [ CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
180180 mainReferences ,
181181 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
182182
183183 // Run the analyzer
184184 DiagnosticAnalyzer analyzer = new EquatableAnalyzer ( ) ;
185185 var compilationWithAnalyzers = mainCompilation . WithAnalyzers (
186- ImmutableArray . Create ( analyzer ) ) ;
186+ [ analyzer ] ) ;
187187
188188 var analyzerDiagnostics = await compilationWithAnalyzers . GetAnalyzerDiagnosticsAsync ( TestContext . Current . CancellationToken ) ;
189189
@@ -214,7 +214,7 @@ public partial record ExternalSettings
214214
215215 var externalCompilation = CSharpCompilation . Create (
216216 "ExternalLib" ,
217- new [ ] { CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
217+ [ CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
218218 CoreReferences ,
219219 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
220220
@@ -244,7 +244,7 @@ public readonly partial record struct ContainerState
244244
245245 var mainCompilation = CSharpCompilation . Create (
246246 "MainApp" ,
247- new [ ] { CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
247+ [ CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
248248 mainReferences ,
249249 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
250250
@@ -288,7 +288,7 @@ public partial record ExternalSettings
288288
289289 var externalCompilation = CSharpCompilation . Create (
290290 "ExternalLib" ,
291- new [ ] { CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
291+ [ CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
292292 CoreReferences ,
293293 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
294294
@@ -311,14 +311,14 @@ public readonly partial record struct ContainerState
311311
312312 var mainCompilation = CSharpCompilation . Create (
313313 "MainApp" ,
314- new [ ] { CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
314+ [ CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
315315 mainReferences ,
316316 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
317317
318318 // Run the analyzer
319319 DiagnosticAnalyzer analyzer = new EquatableAnalyzer ( ) ;
320320 var compilationWithAnalyzers = mainCompilation . WithAnalyzers (
321- ImmutableArray . Create ( analyzer ) ) ;
321+ [ analyzer ] ) ;
322322
323323 var analyzerDiagnostics = await compilationWithAnalyzers . GetAnalyzerDiagnosticsAsync ( TestContext . Current . CancellationToken ) ;
324324
@@ -355,7 +355,7 @@ public partial record ExternalSettings
355355
356356 var externalCompilation = CSharpCompilation . Create (
357357 "ExternalLib" ,
358- new [ ] { CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
358+ [ CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
359359 CoreReferences ,
360360 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
361361
@@ -371,7 +371,7 @@ public partial record ExternalSettings
371371 var reflectionAssembly = System . Reflection . Assembly . LoadFrom ( externalDllPath ) ;
372372 var reflectionType = reflectionAssembly . GetType ( "ExternalLib.ExternalSettings" ) ;
373373 var reflectionAttrs = reflectionType ? . GetCustomAttributes ( false ) ;
374- var reflectionAttrNames = reflectionAttrs ? . Select ( a => a . GetType ( ) . FullName ) . ToList ( ) ?? new List < string > ( ) ;
374+ var reflectionAttrNames = reflectionAttrs ? . Select ( a => a . GetType ( ) . FullName ) . ToList ( ) ?? [ ] ;
375375
376376 // Reference the emitted DLL (not the in-memory compilation)
377377 var externalReference = MetadataReference . CreateFromFile ( externalDllPath ) ;
@@ -393,7 +393,7 @@ public readonly partial record struct ContainerState
393393
394394 var mainCompilation = CSharpCompilation . Create (
395395 "MainApp" ,
396- new [ ] { CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
396+ [ CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
397397 mainReferences ,
398398 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
399399
@@ -442,7 +442,7 @@ public readonly partial record struct ContainerState
442442 // Run the analyzer
443443 DiagnosticAnalyzer analyzer = new EquatableAnalyzer ( ) ;
444444 var compilationWithAnalyzers = mainCompilation . WithAnalyzers (
445- ImmutableArray . Create ( analyzer ) ) ;
445+ [ analyzer ] ) ;
446446
447447 var analyzerDiagnostics = await compilationWithAnalyzers . GetAnalyzerDiagnosticsAsync ( TestContext . Current . CancellationToken ) ;
448448
@@ -485,7 +485,7 @@ public AliasAttribute(string name) { }
485485
486486 var mockPackageCompilation = CSharpCompilation . Create (
487487 "MockPackage" ,
488- new [ ] { CSharpSyntaxTree . ParseText ( mockPackageSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
488+ [ CSharpSyntaxTree . ParseText ( mockPackageSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
489489 CoreReferences ,
490490 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
491491
@@ -509,7 +509,7 @@ public sealed partial record Settings
509509 var externalRefs = CoreReferences . Append ( mockPackageReference ) . ToArray ( ) ;
510510 var externalCompilation = CSharpCompilation . Create (
511511 "ExternalLib" ,
512- new [ ] { CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
512+ [ CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
513513 externalRefs ,
514514 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
515515
@@ -537,7 +537,7 @@ public readonly partial record struct ContainerState
537537
538538 var mainCompilation = CSharpCompilation . Create (
539539 "MainApp" ,
540- new [ ] { CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
540+ [ CSharpSyntaxTree . ParseText ( mainSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
541541 mainReferences ,
542542 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
543543
@@ -560,7 +560,7 @@ public readonly partial record struct ContainerState
560560 // Run the analyzer
561561 DiagnosticAnalyzer analyzer = new EquatableAnalyzer ( ) ;
562562 var compilationWithAnalyzers = mainCompilation . WithAnalyzers (
563- ImmutableArray . Create ( analyzer ) ) ;
563+ [ analyzer ] ) ;
564564
565565 var analyzerDiagnostics = await compilationWithAnalyzers . GetAnalyzerDiagnosticsAsync ( TestContext . Current . CancellationToken ) ;
566566
@@ -592,7 +592,7 @@ public sealed partial record ExternalSettings
592592
593593 var externalCompilation = CSharpCompilation . Create (
594594 "ExternalLib" ,
595- new [ ] { CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) } ,
595+ [ CSharpSyntaxTree . ParseText ( externalSource , cancellationToken : TestContext . Current . CancellationToken ) ] ,
596596 CoreReferences ,
597597 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
598598
@@ -605,7 +605,7 @@ public sealed partial record ExternalSettings
605605
606606 var mainCompilation = CSharpCompilation . Create (
607607 "MainApp" ,
608- new [ ] { CSharpSyntaxTree . ParseText ( "// empty" , cancellationToken : TestContext . Current . CancellationToken ) } ,
608+ [ CSharpSyntaxTree . ParseText ( "// empty" , cancellationToken : TestContext . Current . CancellationToken ) ] ,
609609 CoreReferences . Append ( externalReference ) . ToArray ( ) ,
610610 new CSharpCompilationOptions ( OutputKind . DynamicallyLinkedLibrary ) ) ;
611611
0 commit comments