1 package org.simantics.scl.compiler.internal.elaboration.constraints2;
3 import org.simantics.scl.compiler.types.TPred;
4 import org.simantics.scl.compiler.types.util.TypeUnparsingContext;
6 public class ConstraintHandle {
7 public final TPred constraint;
8 public final long demandLocation;
9 private ConstraintResolution resolution;
11 public ConstraintHandle(TPred constraint, long demandLocation) {
12 this.constraint = constraint;
13 this.demandLocation = demandLocation;
16 public ConstraintResolution getResolution() {
20 public void setResolution(ConstraintResolution newResolution) {
21 if(resolution == null || newResolution.priority > resolution.priority)
22 resolution = newResolution;
25 public String toString(TypeUnparsingContext tuc) {
26 return constraint.toString(tuc) + (resolution != null ? " <= " + resolution.toString(tuc) : "");