Skip to content

Commit 55522ba

Browse files
committed
as enumberable fix
1 parent 68299ab commit 55522ba

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ public override async Task<SyntaxList<StatementSyntax>> VisitMultiLineIfBlock(VB
542542
elseClause = elseClause.WithVbSourceMappingFrom(node.ElseBlock); //Special case where explicit mapping is needed since block becomes clause so cannot be easily visited
543543

544544
var elseIfBlocks = await node.ElseIfBlocks.SelectAsync(async elseIf => await ConvertElseIfAsync(elseIf));
545-
foreach (var elseIf in elseIfBlocks.Reverse()) {
545+
foreach (var elseIf in elseIfBlocks.AsEnumerable().Reverse()) {
546546
var ifStmt = SyntaxFactory.IfStatement(elseIf.ElseIfCondition, elseIf.ElseBlock, elseClause);
547547
elseClause = SyntaxFactory.ElseClause(ifStmt);
548548
}

CodeConverter/CSharp/PerScopeState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public IEnumerable<StatementSyntax> ConvertContinue(VBasic.SyntaxKind vbBlockKey
225225
{
226226
var scopesToExit = _hoistedNodesPerScope.Where(x => x.ExitableKind is not VBasic.SyntaxKind.None).TakeWhile(x => x.ExitableKind != vbBlockKeywordKind && x.IsBreakableInCs).ToArray();
227227
// Select is breakable, but not continuable, so only need to break out of it on the way to something else, not if it's last.
228-
scopesToExit = scopesToExit.Reverse().SkipWhile(x => x.ExitableKind is VBasic.SyntaxKind.SelectKeyword).Reverse().ToArray();
228+
scopesToExit = scopesToExit.AsEnumerable().Reverse().SkipWhile(x => x.ExitableKind is VBasic.SyntaxKind.SelectKeyword).Reverse().ToArray();
229229
var assignmentExpression = CommonConversions.Literal(true);
230230
int i = 0;
231231
foreach (var scope in scopesToExit) {

CodeConverter/CSharp/Replacements/SimpleMethodReplacement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private static ExpressionSyntax ReplacePlaceholderArgs(ExpressionSyntax zeroOrSi
133133
private static bool QualifiedMethodNameMatches(ISymbol symbol, params string[] parts)
134134
{
135135
if (symbol == null) return false;
136-
foreach (var part in parts.Reverse()) {
136+
foreach (var part in parts.AsEnumerable().Reverse()) {
137137
if (!part.Equals(symbol.Name, StringComparison.OrdinalIgnoreCase)) return false;
138138
symbol = symbol.ContainingSymbol;
139139
}

0 commit comments

Comments
 (0)