Skip to content

Commit f2077b5

Browse files
Allow parameter usages to be checked too
1 parent ebcef7f commit f2077b5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ICSharpCode.CodeConverter/CSharp/MethodBodyExecutableStatementVisitor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ private async Task<bool> IsNeverMutatedAsync(VBSyntax.NameSyntax ns)
629629
var allowedLocation = Location.Create(ns.SyntaxTree, TextSpan.FromBounds(ns.GetAncestor<VBSyntax.MethodBlockBaseSyntax>().SpanStart, ns.Span.End));
630630
var symbol = _semanticModel.GetSymbolInfo(ns).Symbol;
631631
//Perf optimization: Looking across the whole solution is expensive, so assume non-local symbols are written somewhere
632-
return symbol is ILocalSymbol && await CommonConversions.Document.Project.Solution.IsNeverWritten(symbol, allowedLocation);
632+
return symbol.MatchesKind(SymbolKind.Parameter, SymbolKind.Local) && await CommonConversions.Document.Project.Solution.IsNeverWritten(symbol, allowedLocation);
633633
}
634634

635635
private CasePatternSwitchLabelSyntax WrapInCasePatternSwitchLabelSyntax(VBSyntax.SelectBlockSyntax node, ExpressionSyntax expression, bool treatAsBoolean = false)

Tests/TestData/MultiFileCharacterization/VBToCSResults/ConvertWholeSolution/VbNetStandardLib/My Project/MyNamespace.Static.Designer.cs

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)