From 9e2006a60e136481354ee6c3238303606fe284ea Mon Sep 17 00:00:00 2001 From: mihaylov Date: Tue, 29 Mar 2005 13:16:53 +0000 Subject: Don't emit widening casts. --- sources/scalac/backend/msil/GenMSIL.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/scalac/backend/msil/GenMSIL.java b/sources/scalac/backend/msil/GenMSIL.java index b937f94bcb..3b695f5243 100644 --- a/sources/scalac/backend/msil/GenMSIL.java +++ b/sources/scalac/backend/msil/GenMSIL.java @@ -1106,7 +1106,8 @@ public final class GenMSIL { emitConvert(uetype, ptype); return items.StackItem(ptype); } - } else if (!item.type.equals(mrtype) && !(rtype == tc.OBJECT)) { + //} else if (!item.type.equals(mrtype) && !(rtype == tc.OBJECT)) { + } else if (!item.type.isSubtypeOf(mrtype) && !(rtype == tc.OBJECT)) { if (rtype.IsValueType()) { code.Emit(OpCodes.Unbox, rtype); if (rtype.IsEnum()) -- cgit v1.2.3