summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorahaase2008-01-28 04:22:38 (EST)
committerahaase2008-01-28 04:22:38 (EST)
commit404449dd7b1dbc1679c7b38f307fdde7d7fe639f (patch)
treee6ca2c99a31ba72e95d979162080b72b1667c0ad
parente35640a05bb1cd9b2a86b3b77a46fc0d5844dbb9 (diff)
downloadorg.eclipse.xpand-404449dd7b1dbc1679c7b38f307fdde7d7fe639f.zip
org.eclipse.xpand-404449dd7b1dbc1679c7b38f307fdde7d7fe639f.tar.gz
org.eclipse.xpand-404449dd7b1dbc1679c7b38f307fdde7d7fe639f.tar.bz2
added backend support for a built-in Map type
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/AbstractType.java3
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/CompositeTypesystem.java5
2 files changed, 6 insertions, 2 deletions
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/AbstractType.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/AbstractType.java
index 8e9a5ee..9b7b67a 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/AbstractType.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/AbstractType.java
@@ -43,9 +43,8 @@ public abstract class AbstractType implements BackendType {
public AbstractType(String name, BackendType... superTypes) {
_name = name;
- if (superTypes.length == 0) {
+ if (superTypes.length == 0)
_superTypes = Collections.singletonList((BackendType) ObjectType.INSTANCE);
- }
else
_superTypes = Arrays.asList(superTypes);
}
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/CompositeTypesystem.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/CompositeTypesystem.java
index ff3394a..4686a35 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/CompositeTypesystem.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/CompositeTypesystem.java
@@ -13,6 +13,7 @@ package org.eclipse.xtend.backend.types;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.xtend.backend.common.BackendType;
@@ -26,6 +27,7 @@ import org.eclipse.xtend.backend.types.builtin.DoubleType;
import org.eclipse.xtend.backend.types.builtin.FunctionType;
import org.eclipse.xtend.backend.types.builtin.ListType;
import org.eclipse.xtend.backend.types.builtin.LongType;
+import org.eclipse.xtend.backend.types.builtin.MapType;
import org.eclipse.xtend.backend.types.builtin.ObjectType;
import org.eclipse.xtend.backend.types.builtin.PropertyType;
import org.eclipse.xtend.backend.types.builtin.SetType;
@@ -104,6 +106,9 @@ public final class CompositeTypesystem implements BackendTypesystem {
if (Collection.class.isAssignableFrom(cls))
return CollectionType.INSTANCE;
+ if (Map.class.isAssignableFrom(cls))
+ return MapType.INSTANCE;
+
if (CharSequence.class.isAssignableFrom(cls))
return StringType.INSTANCE;