Assign to shared_ptr member in script: "Error, cannot assign to temporary value."

As the title says.
I did find out i can work around that using a tiny setter,
but i am still wondering why i can’t directly set it.

#include <chaiscript/chaiscript.hpp>
#include <chaiscript/dispatchkit/bootstrap_stl.hpp>
#include <memory>
using namespace std;
using namespace chaiscript;

struct A {
        int i{123};
};

struct B {
        shared_ptr<A> p;
};

int main() {
        ChaiScript chai;

        auto aptr = make_shared<A>();

        chai.add_global(chaiscript::var(aptr),"aptr");

        auto module = make_shared<Module>();

        module->add(user_type<A>(), "A");
        module->add(fun(&A::i), "i");

        module->add(user_type<B>(), "B");
        module->add(constructor<B()>(), "B");
        module->add(fun(&B::p), "p");
        module->add(fun([](B & b,shared_ptr<A> ptr){b.p = ptr;}), "set_p");

        chai.add(module);

        chai.eval(R"(
                var b = B();
                print(aptr.i.to_string()); // OK: 123

                var a := aptr;
                print(a.i.to_string()); // OK: 123

                b.set_p(aptr);
                print(b.p.i.to_string()); // OK: 123

                //b.p = a; // "Error, cannot assign to temporary value."
                //b.p := a; // "Error, cannot assign to temporary value."
        )");
}

EDIT: This is on release 6.1.0.