Skip to content

Commit 1b2f264

Browse files
committed
Make suggested change to TreeNode::setOuput
1 parent f5e98fd commit 1b2f264

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/behaviortree_cpp/tree_node.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,12 @@ inline Result TreeNode::setOutput(const std::string& key, const T& value)
585585

586586
if constexpr(std::is_same_v<BT::Any, T>)
587587
{
588-
if(config().manifest->ports.at(key).type() != typeid(BT::Any))
588+
const std::type_index type = config().manifest->ports.at(key).type();
589+
if(type != typeid(BT::Any) && type != typeid(BT::AnyTypeAllowed))
589590
{
590-
throw LogicError("setOutput<Any> is not allowed, unless the port "
591-
"was declared using OutputPort<Any>");
591+
throw LogicError("setOutput<BT::Any> is not allowed, unless the port "
592+
"was declared using OutputPort<BT::Any> or "
593+
"OutputPort<BT::AnyTypeAllowed>");
592594
}
593595
}
594596

0 commit comments

Comments
 (0)