You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The benchmark and test failures are caused by removing .ToArray() in this PR.
Tokenizer.Tokenize(source) returns a lazy IEnumerable backed by a forward-only TextReader. The old .ToArray() eagerly materialised all tokens before any converter touched them. Without it, BlockAccumulator.ConvertTokens consumes the enumerator while building block expressions, and a downstream LINQ operation then gets an already-exhausted iterator — causing System.InvalidOperationException: Sequence contains no elements in the benchmark and test runs.
The .ToArray() is load-bearing: the token stream is a single-pass reader that cannot be re-enumerated. Removing it is not safe here.
Fix: restore the .ToArray() call, or materialise the sequence at the point where it's first passed into the converter pipeline.
Claude recommended the "fix" but I think this PR is just not valid. We do need the array allocation here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.