From fee292c3cdb8bf5ffd307e8a3a967425f0815af9 Mon Sep 17 00:00:00 2001 From: NiJingzhe <1448976235@qq.com> Date: Fri, 30 Oct 2026 03:01:14 +0800 Subject: [PATCH] refactor(optional): the last unchecked optional access (selection.cpp) uses require_engaged clang-tidy on the previous commit left one site of 70: reservation.value() on the line after if (reservation), which its dataflow no longer follows across the calls in between. Same helper as the other 69 sites; behaviour unchanged. Co-Authored-By: Claude Sonnet 5.5 --- src/cpp/src/semantic/selection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpp/src/semantic/selection.cpp b/src/cpp/src/semantic/selection.cpp index 7981f068..1bb52415 100644 --- a/src/cpp/src/semantic/selection.cpp +++ b/src/cpp/src/semantic/selection.cpp @@ -13,6 +13,7 @@ #include #include "detail.hpp" +#include "scad/core/engaged.hpp" #include "scad/core/error.hpp" #include "scad/topo/recorder.hpp" #include "scad/topo/tag_factories.hpp" @@ -509,7 +510,7 @@ Shape assign_tag(const Shape& scope, const TagTargets& targets, std::string_view record.params = object({{"tag_binding", binding.to_value()}}); record.inputs.push_back({scope, "scope"}); if (reservation) - record.node_id = reservation.value().node_id; // engaged: just tested; value() never throws here + record.node_id = require_engaged(reservation, "a reserved node is tested on the line above").node_id; recorder->record(record, {view}); } return view;