Browse Source

reviewed patch by aleksoft

pull/18/head
Siegfried Pammer 14 years ago
parent
commit
b5c482d4c2
  1. 12
      src/AddIns/Debugger/Debugger.Core/NRefactory/Visitors/ExpressionEvaluator.cs

12
src/AddIns/Debugger/Debugger.Core/NRefactory/Visitors/ExpressionEvaluator.cs

@ -339,14 +339,12 @@ namespace ICSharpCode.NRefactory.Visitors
{ {
TypedValue val = Evaluate(castExpression.Expression); TypedValue val = Evaluate(castExpression.Expression);
DebugType castTo = null; DebugType castTo = null;
try try {
{
castTo = castExpression.CastTo.ResolveType(context.AppDomain);
}
catch(System.Exception e)
{
castExpression.CastTo.Type = castExpression.CastTo.Type.Insert(0,context.MethodInfo.DeclaringType.Namespace + ".");
castTo = castExpression.CastTo.ResolveType(context.AppDomain); castTo = castExpression.CastTo.ResolveType(context.AppDomain);
} catch (GetValueException) {
var typeRef = castExpression.CastTo.Clone();
typeRef.Type = typeRef.Type.Insert(0, context.MethodInfo.DeclaringType.Namespace + ".");
castTo = typeRef.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;

Loading…
Cancel
Save