|
|
|
@ -351,6 +351,7 @@ namespace ICSharpCode.NRefactory.Visitors |
|
|
|
{ |
|
|
|
{ |
|
|
|
TypedValue val = Evaluate(castExpression.Expression); |
|
|
|
TypedValue val = Evaluate(castExpression.Expression); |
|
|
|
DebugType castTo = castExpression.Type.ResolveType(context.AppDomain); |
|
|
|
DebugType castTo = castExpression.Type.ResolveType(context.AppDomain); |
|
|
|
|
|
|
|
|
|
|
|
if (castTo.IsPrimitive && val.Type.IsPrimitive && castTo != val.Type) { |
|
|
|
if (castTo.IsPrimitive && val.Type.IsPrimitive && castTo != val.Type) { |
|
|
|
object oldVal = val.PrimitiveValue; |
|
|
|
object oldVal = val.PrimitiveValue; |
|
|
|
object newVal; |
|
|
|
object newVal; |
|
|
|
@ -403,7 +404,7 @@ namespace ICSharpCode.NRefactory.Visitors |
|
|
|
|
|
|
|
|
|
|
|
// Instance class members
|
|
|
|
// Instance class members
|
|
|
|
// Note that the method might be generated instance method that represents anonymous method
|
|
|
|
// Note that the method might be generated instance method that represents anonymous method
|
|
|
|
TypedValue thisValue = GetThisValue(); |
|
|
|
TypedValue thisValue = this.GetThisValue(); |
|
|
|
if (thisValue != null) { |
|
|
|
if (thisValue != null) { |
|
|
|
IDebugMemberInfo instMember = (IDebugMemberInfo)thisValue.Type.GetMember<MemberInfo>(identifier, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, DebugType.IsFieldOrNonIndexedProperty); |
|
|
|
IDebugMemberInfo instMember = (IDebugMemberInfo)thisValue.Type.GetMember<MemberInfo>(identifier, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, DebugType.IsFieldOrNonIndexedProperty); |
|
|
|
if (instMember != null) |
|
|
|
if (instMember != null) |
|
|
|
@ -572,10 +573,7 @@ namespace ICSharpCode.NRefactory.Visitors |
|
|
|
TypedValue GetThisValue() |
|
|
|
TypedValue GetThisValue() |
|
|
|
{ |
|
|
|
{ |
|
|
|
// This is needed so that captured 'this' is supported
|
|
|
|
// This is needed so that captured 'this' is supported
|
|
|
|
DebugLocalVariableInfo thisVar = context.MethodInfo.GetLocalVariableThis(); |
|
|
|
return new TypedValue(context.GetThisValue(), (DebugType)context.MethodInfo.DeclaringType); |
|
|
|
if (thisVar != null) |
|
|
|
|
|
|
|
return new TypedValue(thisVar.GetValue(context), (DebugType)thisVar.LocalType); |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public override object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data) |
|
|
|
public override object VisitThisReferenceExpression(ThisReferenceExpression thisReferenceExpression, object data) |
|
|
|
|