operator-assign.go -- Fix: Assigning a functor to a collection's item didn't work
This commit is contained in:
parent
d8aed9dd7a
commit
990e04f957
@ -76,6 +76,7 @@ func evalAssign(ctx ExprContext, opTerm *term) (v any, err error) {
|
|||||||
|
|
||||||
if v, err = rightChild.compute(ctx); err == nil {
|
if v, err = rightChild.compute(ctx); err == nil {
|
||||||
if functor, ok := v.(Functor); ok {
|
if functor, ok := v.(Functor); ok {
|
||||||
|
if leftSym == SymVariable {
|
||||||
if info := functor.GetFunc(); info != nil {
|
if info := functor.GetFunc(); info != nil {
|
||||||
ctx.RegisterFunc(leftTerm.source(), info.Functor(), info.ReturnType(), info.Params())
|
ctx.RegisterFunc(leftTerm.source(), info.Functor(), info.ReturnType(), info.Params())
|
||||||
} else if funcDef, ok := functor.(*exprFunctor); ok {
|
} else if funcDef, ok := functor.(*exprFunctor); ok {
|
||||||
@ -88,6 +89,9 @@ func evalAssign(ctx ExprContext, opTerm *term) (v any, err error) {
|
|||||||
} else {
|
} else {
|
||||||
err = assignValue(ctx, leftTerm, v)
|
err = assignValue(ctx, leftTerm, v)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
err = assignValue(ctx, leftTerm, v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
v = nil
|
v = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user