@ -231,27 +231,17 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms
if ( initializer . DescendantsAndSelf . Any ( n = > n is ThisReferenceExpression | | n is BaseReferenceExpression ) )
if ( initializer . DescendantsAndSelf . Any ( n = > n is ThisReferenceExpression | | n is BaseReferenceExpression ) )
break ;
break ;
bool assignFromCurrentCtorParameters = false ;
var v = initializer . Annotation < ILVariableResolveResult > ( ) ? . Variable ;
var v = initializer . Annotation < ILVariableResolveResult > ( ) ? . Variable ;
if ( v = = null )
bool assignFromCurrentCtorParameters = v ? . Kind = = IL . VariableKind . Parameter ;
{
if ( ! assignFromCurrentCtorParameters )
v = ( initializer . Annotation < ByReferenceResolveResult > ( ) ? . ElementResult as ILVariableResolveResult ) ? . Variable ;
}
if ( v ! = null )
{
assignFromCurrentCtorParameters = v . Kind = = IL . VariableKind . Parameter ;
}
else
{
{
// If we didn't get an ILVariableResolveResult for the whole initializer expression,
// If we didn't get an ILVariableResolveResult for the whole initializer expression,
// walk its descendants and try to find any reference that corresponds to a
// walk its descendants and try to find any reference that corresponds to a
// constructor parameter. We consider both ILVariable annotations (including
// constructor parameter. We consider both ILVariable annotations (including
// by-reference wrappers) and high-level parameter symbols.
// by-reference wrappers) and high-level parameter symbols.
foreach ( var node in initializer . DescendantsAndSelf )
foreach ( var node in initializer . Descendants )
{
{
var localVar = node . Annotation < ILVariableResolveResult > ( ) ? . Variable
var localVar = node . Annotation < ILVariableResolveResult > ( ) ? . Variable ;
? ? ( node . Annotation < ByReferenceResolveResult > ( ) ? . ElementResult as ILVariableResolveResult ) ? . Variable ;
if ( localVar ! = null )
if ( localVar ! = null )
{
{
if ( localVar . Kind = = IL . VariableKind . Parameter )
if ( localVar . Kind = = IL . VariableKind . Parameter )