aboutsummaryrefslogtreecommitdiff
path: root/src/interp/i-coerce.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/i-coerce.boot')
-rw-r--r--src/interp/i-coerce.boot7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot
index e0c896e4..2f7c8db3 100644
--- a/src/interp/i-coerce.boot
+++ b/src/interp/i-coerce.boot
@@ -985,6 +985,11 @@ coerceIntAlgebraicConstant(object,t2) ==
objNewWrap(getConstantFromDomain('(Zero),t2),t2)
NIL
+++ returns true if `val' belongs to the Union branch guarded by `pred'.
+thisUnionBranch?: (%Code,%Thing) -> %Boolean
+thisUnionBranch?(pred,val) ==
+ eval ["LET",[["#1",MKQ val]],pred]
+
coerceUnion2Branch(object) ==
[.,:unionDoms] := objMode object
doms := orderUnionEntries unionDoms
@@ -994,7 +999,7 @@ coerceUnion2Branch(object) ==
predicate := NIL
targetType:= NIL
for typ in doms for pred in predList while ^targetType repeat
- evalSharpOne(pred,val') =>
+ thisUnionBranch?(pred,val') =>
predicate := pred
targetType := typ
null targetType => keyedSystemError("S2IC0013",NIL)