adapted and enhanced the dict operations to make them compatible with the new DictType
This commit is contained in:
+4
-6
@@ -62,12 +62,10 @@ func evalPlus(ctx ExprContext, self *term) (v any, err error) {
|
||||
v, err = sumAnyFract(leftValue, rightValue)
|
||||
}
|
||||
} else if IsDict(leftValue) && IsDict(rightValue) {
|
||||
leftDict, _ := leftValue.(map[any]any)
|
||||
rightDict, _ := rightValue.(map[any]any)
|
||||
c := CloneMap(leftDict)
|
||||
for key, value := range rightDict {
|
||||
c[key] = value
|
||||
}
|
||||
leftDict, _ := leftValue.(*DictType)
|
||||
rightDict, _ := rightValue.(*DictType)
|
||||
c := leftDict.clone()
|
||||
c.merge(rightDict)
|
||||
v = c
|
||||
} else {
|
||||
err = self.errIncompatibleTypes(leftValue, rightValue)
|
||||
|
||||
Reference in New Issue
Block a user