Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions include/behaviortree_cpp/tree_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,12 @@ inline Result TreeNode::setOutput(const std::string& key, const T& value)

if constexpr(std::is_same_v<BT::Any, T>)
{
if(config().manifest->ports.at(key).type() != typeid(BT::Any))
const std::type_index type = config().manifest->ports.at(key).type();
if(type != typeid(BT::Any) && type != typeid(BT::AnyTypeAllowed))
{
throw LogicError("setOutput<Any> is not allowed, unless the port "
"was declared using OutputPort<Any>");
throw LogicError("setOutput<BT::Any> is not allowed, unless the port "
"was declared using OutputPort<BT::Any> or "
"OutputPort<BT::AnyTypeAllowed>");
}
}

Expand Down
Loading