File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ abstract class Type implements OperatorMeta, FormulaPart {
24
24
* Otherwise null.
25
25
* @var array<Value>|null
26
26
*/
27
- private ?array $ restrictedValues ;
27
+ private ?array $ restrictedValues = null ;
28
28
29
29
public function __construct (?array $ restrictedValues = null ) {
30
30
$ this ->restrictedValues = $ restrictedValues ;
@@ -128,7 +128,9 @@ public function getOperatorResultType(ImplementableOperator $operator, ?Type $ot
128
128
$ valueA = $ this ->restrictedValues [0 ];
129
129
$ valueB = $ otherRestrictedValues [0 ];
130
130
try {
131
- $ type = $ type ->setRestrictedValues ([$ valueA ->operate ($ operator , $ valueB )]);
131
+ if (!$ type ->isAssignable ()) {
132
+ $ type = $ type ->setRestrictedValues ([$ valueA ->operate ($ operator , $ valueB )]);
133
+ }
132
134
} catch (FormulaRuntimeException ) { // catch division by zero and similar
133
135
$ type = $ type ->setRestrictedValues (null );
134
136
}
You can’t perform that action at this time.
0 commit comments