From 6f37510a710d0a27941eb24b02c920524b0fc19c Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Fri, 26 Nov 2021 22:38:40 +0100 Subject: [PATCH] AK: Implement missing const getters in AK::Error, fix typo Note that the return type for the non-const method error() changed. This is most likely an accident, hidden by the fact that ErrorType typically is Error. --- AK/Error.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AK/Error.h b/AK/Error.h index b25e8348ee..1318b206a1 100644 --- a/AK/Error.h +++ b/AK/Error.h @@ -93,7 +93,9 @@ public: ErrorOr& operator=(ErrorOr const& other) = default; T& value() { return m_value.value(); } - Error& error() { return m_error.value(); } + T const& value() const { return m_value.value(); } + ErrorType& error() { return m_error.value(); } + ErrorType const& error() const { return m_error.value(); } bool is_error() const { return m_error.has_value(); }