]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/NamespaceImpl.java
Merge "Ensure GetElementClassRequest is not constructed without elementFactory"
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / environment / NamespaceImpl.java
index bb98f1aa529b019274cf1252069126595a8db0df..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;
@@ -131,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) {
@@ -213,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;