diff options
| author | Lexi Winter <lexi@le-fay.org> | 2025-06-27 12:08:58 +0100 |
|---|---|---|
| committer | Lexi Winter <lexi@le-fay.org> | 2025-06-27 12:08:58 +0100 |
| commit | 001c9917ace09f7b1c80d96eb067e1d37e86c546 (patch) | |
| tree | 89e360961b9659a8c6b897c5412b7d6834b8eed9 /nihil.ucl/type.cc | |
| parent | 90aa957ca9b7c217af7569009d1675e0f3ff8e9b (diff) | |
| download | nihil-001c9917ace09f7b1c80d96eb067e1d37e86c546.tar.gz nihil-001c9917ace09f7b1c80d96eb067e1d37e86c546.tar.bz2 | |
improve error handling
Diffstat (limited to 'nihil.ucl/type.cc')
| -rw-r--r-- | nihil.ucl/type.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/nihil.ucl/type.cc b/nihil.ucl/type.cc index a008aa3..7d9cad7 100644 --- a/nihil.ucl/type.cc +++ b/nihil.ucl/type.cc @@ -39,24 +39,24 @@ auto str(object_type type) -> std::string_view { } } -type_mismatch::type_mismatch( - object_type expected_type, object_type actual_type) - : error(std::format("UCL type mismatch: expected type '{}' " - "!= actual type '{}'", - str(expected_type), str(actual_type))) - , _expected_type(expected_type) - , _actual_type(actual_type) +type_mismatch::type_mismatch(object_type expected_type, + object_type actual_type) + : error(std::format( + "expected type '{}' != actual type '{}'", + ucl::str(expected_type), ucl::str(actual_type))) + , m_expected_type(expected_type) + , m_actual_type(actual_type) { } auto type_mismatch::expected_type(this type_mismatch const &self) -> object_type { - return self._expected_type; + return self.m_expected_type; } auto type_mismatch::actual_type(this type_mismatch const &self) -> object_type { - return self._actual_type; + return self.m_actual_type; } } // namespace nihil::ucl |
