diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/Utils.java @ 11543:90c45cbbf9de

Truffle-DSL: fixed a bug in isAssignable.
author Christian Humer <christian.humer@gmail.com>
date Fri, 06 Sep 2013 16:10:09 +0200
parents 43eab069ca9b
children 8970574702a4
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/Utils.java	Fri Sep 06 16:08:59 2013 +0200
+++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/Utils.java	Fri Sep 06 16:10:09 2013 +0200
@@ -192,6 +192,10 @@
             return true;
         }
 
+        if (isObject(to)) {
+            return true;
+        }
+
         // JLS 5.1.2 widening primitives
         if (Utils.isPrimitive(from) && Utils.isPrimitive(to)) {
             TypeKind fromKind = from.getKind();
@@ -257,6 +261,10 @@
             return isAssignable(context, ((ArrayType) from).getComponentType(), ((ArrayType) to).getComponentType());
         }
 
+        if (from instanceof ArrayType || to instanceof ArrayType) {
+            return false;
+        }
+
         TypeElement fromType = Utils.fromTypeMirror(from);
         TypeElement toType = Utils.fromTypeMirror(to);
         if (fromType == null || toType == null) {