summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/ErrorOr.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-29 10:48:12 +0200
committerGitHub <noreply@github.com>2025-05-29 10:48:12 +0200
commit433bb5ef102b2bfa0049468be00d63011da8b973 (patch)
treee0893a30710477045a5bb085cb7a27aada425c14 /dev/LibCompiler/ErrorOr.h
parent1ddeab9a4426abd781a5066ba79af2ba64de11d9 (diff)
parent756ee7f8dc954e27350fe5bdfbaa83b9f69780c8 (diff)
Merge pull request #6 from nekernel-org/dev
0.0.2e3
Diffstat (limited to 'dev/LibCompiler/ErrorOr.h')
-rw-r--r--dev/LibCompiler/ErrorOr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/dev/LibCompiler/ErrorOr.h b/dev/LibCompiler/ErrorOr.h
index ca93dd2..77015b1 100644
--- a/dev/LibCompiler/ErrorOr.h
+++ b/dev/LibCompiler/ErrorOr.h
@@ -10,6 +10,7 @@
#pragma once
#include <LibCompiler/Defines.h>
+#include <LibCompiler/ErrorID.h>
#include <LibCompiler/Ref.h>
namespace LibCompiler {
@@ -33,6 +34,10 @@ class ErrorOr final {
Ref<T> Leak() { return mRef; }
+ Int32 Error() { return mId; }
+
+ BOOL HasError() { return mId != LIBCOMPILER_SUCCESS; }
+
operator bool() { return mRef; }
private: