diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs index 8276be95bb..800c121f1c 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Legacy/CSharpCodeParser.cs @@ -1271,7 +1271,7 @@ internal class CSharpCodeParser : TokenizerBackedParser chunkGenerator = chunkGeneratorFactory( directiveValue, - directiveErrorSink.GetErrorsAndClear().ToList(), + [.. directiveErrorSink.GetErrorsAndClear()], valueStartLocation ?? CurrentStart); }