summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2005-03-29 13:16:53 +0000
committermihaylov <mihaylov@epfl.ch>2005-03-29 13:16:53 +0000
commit9e2006a60e136481354ee6c3238303606fe284ea (patch)
treedf4355f0d8c7c41e60390300aa4cfa20b720f4da
parenta95c0558aae283ebc337255413956a8f61cc746b (diff)
downloadscala-9e2006a60e136481354ee6c3238303606fe284ea.tar.gz
scala-9e2006a60e136481354ee6c3238303606fe284ea.tar.bz2
scala-9e2006a60e136481354ee6c3238303606fe284ea.zip
Don't emit widening casts.
-rw-r--r--sources/scalac/backend/msil/GenMSIL.java3
1 files changed, 2 insertions, 1 deletions
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())