We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
None
When the value of an optional nyan member is retrieved but the value is None, the retrieval currently fails with the error
optional
Traceback (most recent call last): -> ? [0x555555569845] -> __libc_start_main+0x8b [0x7ffff742a28b] -> ? [0x7ffff742a1ca] -> ? [0x55555556ca68] -> ? [0x55555556bfa6] -> ? [0x555555569f94] -> std::optional<std::shared_ptr<nyan::Object> > nyan::Object::get_optional<nyan::Object, true>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long) const+0x44 [0x7ffff7e7d144] -> std::optional<std::shared_ptr<nyan::ObjectValue> > nyan::Object::get_optional<nyan::ObjectValue, true>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long) const+0x5e [0x7ffff7e7f6c2] -> nyan::Object::get_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long) const+0x43 [0x7ffff7e7ca79] -> nyan::Object::calculate_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long) const+0x2cf [0x7ffff7e7d52b] -> nyan::Value::apply(nyan::Member const&)+0x51 [0x7ffff7ed920d] -> nyan::None::apply_value(nyan::Value const&, nyan::nyan_op)+0x69 [0x7ffff7ebcd03] -> nyan::InternalError::InternalError(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x2e [0x7ffff7e6148c] -> nyan::Error::Error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool)+0xed [0x7ffff7e60a83] -> nyan::Backtrace::analyze()+0x64 [0x7ffff7e60508] nyan::InternalError: None can't get an applied value - assign Value directly to member instead
Note that this only happens when None is assigned in a parent member.
nyan data:
First(): member : optional(int) = None Second(First): pass
Code:
Object second = db.get_object("Second"); std::optional<int> member_val = second.get_optional<int, true>("member");
optional member values can be retrieved without crashes.
The text was updated successfully, but these errors were encountered:
Object::calculate_value
Successfully merging a pull request may close this issue.
When the value of an
optional
nyan member is retrieved but the value isNone
, the retrieval currently fails with the errorNote that this only happens when
None
is assigned in a parent member.How to reproduce
nyan data:
Code:
Expected Result
optional member values can be retrieved without crashes.
The text was updated successfully, but these errors were encountered: