|
|
|
|
@ -63,7 +63,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
@@ -63,7 +63,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
|
|
|
|
|
protected abstract NodeKind GetNodeKind (AstNode node); |
|
|
|
|
|
|
|
|
|
protected virtual bool CanReachModification (ControlFlowNode node, Statement start, |
|
|
|
|
IDictionary<Statement, IList<Node>> modifications) |
|
|
|
|
IDictionary<Statement, IList<Node>> modifications) |
|
|
|
|
{ |
|
|
|
|
return node.NextStatement != null && node.NextStatement != start && |
|
|
|
|
modifications.ContainsKey (node.NextStatement); |
|
|
|
|
@ -98,13 +98,15 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
@@ -98,13 +98,15 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
|
|
|
|
|
CheckVariable (((LocalResolveResult)ctx.Resolve (variableInitializer)).Variable, |
|
|
|
|
variableDecl.Type, |
|
|
|
|
variableDecl.GetParent<Statement> ()); |
|
|
|
|
base.VisitVariableInitializer (variableInitializer); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void VisitForeachStatement (ForeachStatement foreachStatement) |
|
|
|
|
{ |
|
|
|
|
CheckVariable (((LocalResolveResult)ctx.Resolve (foreachStatement.VariableNameToken)).Variable, |
|
|
|
|
foreachStatement.VariableType, |
|
|
|
|
foreachStatement.VariableType, |
|
|
|
|
foreachStatement); |
|
|
|
|
base.VisitForeachStatement (foreachStatement); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override void VisitParameterDeclaration (ParameterDeclaration parameterDeclaration) |
|
|
|
|
@ -121,8 +123,9 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
@@ -121,8 +123,9 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
|
|
|
|
|
body = ((ConstructorDeclaration)parent).Body; |
|
|
|
|
} |
|
|
|
|
if (body != null) |
|
|
|
|
CheckVariable (((LocalResolveResult)ctx.Resolve (parameterDeclaration)).Variable, |
|
|
|
|
CheckVariable (((LocalResolveResult)ctx.Resolve (parameterDeclaration)).Variable, |
|
|
|
|
parameterDeclaration.Type, body); |
|
|
|
|
base.VisitParameterDeclaration (parameterDeclaration); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void FindLocalReferences (IVariable variable, FoundReferenceCallback callback) |
|
|
|
|
|