From 1f25fa80edc6758c5058dd06fe651ef775668852 Mon Sep 17 00:00:00 2001 From: Dieter Baron Date: Fri, 5 Jan 2024 10:20:21 +0100 Subject: [PATCH] Fix warning. --- src/ValueExpression.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ValueExpression.cc b/src/ValueExpression.cc index 277de96..ac334fd 100644 --- a/src/ValueExpression.cc +++ b/src/ValueExpression.cc @@ -34,7 +34,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Base64.h" #include "ParseException.h" -ValueExpression::ValueExpression(const Token &token) { +ValueExpression::ValueExpression(const Token& token) { if (token.is_value()) { value_ = token.as_value(); } @@ -46,8 +46,7 @@ ValueExpression::ValueExpression(const Token &token) { } } - -void ValueExpression::serialize_sub(std::ostream &stream) const { +void ValueExpression::serialize_sub(std::ostream& stream) const { switch (value()->type()) { case Value::BINARY: { stream << "{{"; @@ -88,6 +87,10 @@ void ValueExpression::serialize_sub(std::ostream &stream) const { case Value::VOID: stream << "void"; break; + + case Value::INTEGER: + case Value::NUMBER: + throw Exception("internal error: value can't have abstract type %s", value()->type_name().c_str()); } } @@ -98,4 +101,4 @@ std::optional ValueExpression::maximum_value() const { else { return {}; } -} \ No newline at end of file +}