]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/NamespaceImpl.java
Merged changes from feature/scl to master.
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / environment / NamespaceImpl.java
index 98666c11a16bab50cf93723f2fdb26f5af413b95..6dac77acf029d54aa3dc9f641de6bd5c0fc006af 100644 (file)
@@ -4,9 +4,8 @@ import java.util.ArrayList;
 import java.util.function.Consumer;
 
 import org.simantics.scl.compiler.elaboration.modules.SCLValue;
-import org.simantics.scl.compiler.elaboration.modules.TypeAlias;
 import org.simantics.scl.compiler.elaboration.modules.TypeClass;
-import org.simantics.scl.compiler.elaboration.modules.TypeConstructor;
+import org.simantics.scl.compiler.elaboration.modules.TypeDescriptor;
 import org.simantics.scl.compiler.elaboration.relations.SCLEntityType;
 import org.simantics.scl.compiler.elaboration.relations.SCLRelation;
 import org.simantics.scl.compiler.elaboration.rules.MappingRelation;
@@ -33,13 +32,6 @@ public class NamespaceImpl implements Namespace {
             this.module = module;
             this.filter = filter;
         }
-        
-        @Override
-        public String toString() {
-            StringBuilder sb = new StringBuilder();
-            sb.append("ModuleImport \"").append(module).append("\"").append(" with filter ").append(filter);
-            return sb.toString();
-        }
     }
     
     public NamespaceImpl(THashMap<String, Namespace> namespaceMap,
@@ -138,14 +130,14 @@ public class NamespaceImpl implements Namespace {
     }
 
     @Override
-    public TypeConstructor getTypeConstructor(String name)
+    public TypeDescriptor getTypeDescriptor(String name)
             throws AmbiguousNameException {
-        TypeConstructor result = null, temp;
+        TypeDescriptor result = null, temp;
         Module resultModule = null;
         ArrayList<String> conflictingModules = null;
         for(ModuleImport moduleImport : moduleImports) {
             Module module = moduleImport.module;
-            temp = module.getTypeConstructor(name);
+            temp = module.getTypeDescriptor(name);
             if(temp != null) {
                 if(result != null) {
                     if(conflictingModules == null) {
@@ -220,33 +212,6 @@ public class NamespaceImpl implements Namespace {
         return result;
     }
 
-    @Override
-    public TypeAlias getTypeAlias(String name) throws AmbiguousNameException {
-        TypeAlias result = null, temp;
-        Module resultModule = null;
-        ArrayList<String> conflictingModules = null;
-        for(ModuleImport moduleImport : moduleImports) {
-            Module module = moduleImport.module;
-            temp = module.getTypeAlias(name);
-            if(temp != null) {
-                if(result != null) {
-                    if(conflictingModules == null) {
-                        conflictingModules = new ArrayList<String>(2);
-                        conflictingModules.add(resultModule.getName());
-                    }
-                    conflictingModules.add(module.getName());
-                }   
-                else {
-                    result = temp;
-                    resultModule = module;
-                }
-            }
-        }
-        if(conflictingModules != null)
-            throw new AmbiguousNameException(conflictingModules, name);
-        return result;
-    }
-
     @Override
     public MappingRelation getMappingRelation(String name) throws AmbiguousNameException {
         MappingRelation result = null, temp;