]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/relations/UnresolvedCHRRelation.java
(refs #7375) Fixed implementation of collectEffects
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / chr / relations / UnresolvedCHRRelation.java
index 28944ce492b33ea719916ce17bbbc86cf8cae7a7..6cf2930de5a7adb2c4f954195da6e76e0aa5abd3 100644 (file)
@@ -1,26 +1,44 @@
-package org.simantics.scl.compiler.elaboration.chr.relations;\r
-\r
-import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;\r
-import org.simantics.scl.compiler.elaboration.chr.CHRRelation;\r
-import org.simantics.scl.compiler.internal.parsing.Symbol;\r
-import org.simantics.scl.compiler.types.TVar;\r
-import org.simantics.scl.compiler.types.Type;\r
-\r
-public class UnresolvedCHRRelation extends Symbol implements CHRRelation {\r
-    public String name;\r
-\r
-    public UnresolvedCHRRelation(long location, String name) {\r
-        this.location = location;\r
-        this.name = name;\r
-    }\r
-\r
-    @Override\r
-    public Type[] getParameterTypes() {\r
-        throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");\r
-    }\r
-\r
-    @Override\r
-    public TVar[] getTypeVariables() {\r
-        throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");\r
-    }\r
-}\r
+package org.simantics.scl.compiler.elaboration.chr.relations;
+
+import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
+import org.simantics.scl.compiler.elaboration.chr.CHRRelation;
+import org.simantics.scl.compiler.internal.parsing.Symbol;
+import org.simantics.scl.compiler.types.TPred;
+import org.simantics.scl.compiler.types.TVar;
+import org.simantics.scl.compiler.types.Type;
+import org.simantics.scl.compiler.types.Types;
+
+import gnu.trove.set.hash.THashSet;
+
+public class UnresolvedCHRRelation extends Symbol implements CHRRelation {
+    public String name;
+
+    public UnresolvedCHRRelation(long location, String name) {
+        this.location = location;
+        this.name = name;
+    }
+
+    @Override
+    public Type[] getParameterTypes() {
+        throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");
+    }
+
+    @Override
+    public TVar[] getTypeVariables() {
+        throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");
+    }
+    
+    public TPred[] getTypeConstraints() {
+        throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");
+    }
+
+    @Override
+    public void collectEnforceEffects(THashSet<Type> effects) {
+        effects.add(Types.PROC);
+    }
+
+    @Override
+    public void collectQueryEffects(THashSet<Type> effects) {
+        effects.add(Types.PROC);
+    }
+}