]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 package org.simantics.scl.compiler.elaboration.chr.relations;
2
3 import org.simantics.scl.compiler.common.exceptions.InternalCompilerError;
4 import org.simantics.scl.compiler.elaboration.chr.CHRRelation;
5 import org.simantics.scl.compiler.internal.parsing.Symbol;
6 import org.simantics.scl.compiler.types.TPred;
7 import org.simantics.scl.compiler.types.TVar;
8 import org.simantics.scl.compiler.types.Type;
9 import org.simantics.scl.compiler.types.Types;
10
11 import gnu.trove.set.hash.THashSet;
12
13 public class UnresolvedCHRRelation extends Symbol implements CHRRelation {
14     public String name;
15
16     public UnresolvedCHRRelation(long location, String name) {
17         this.location = location;
18         this.name = name;
19     }
20
21     @Override
22     public Type[] getParameterTypes() {
23         throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");
24     }
25
26     @Override
27     public TVar[] getTypeVariables() {
28         throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");
29     }
30     
31     public TPred[] getTypeConstraints() {
32         throw new InternalCompilerError("Encountered unresolved CHRRelation during type checking.");
33     }
34
35     @Override
36     public void collectEnforceEffects(THashSet<Type> effects) {
37         effects.add(Types.PROC);
38     }
39
40     @Override
41     public void collectQueryEffects(THashSet<Type> effects) {
42         effects.add(Types.PROC);
43     }
44 }