summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/overload/type-checker.hh
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-09-15 01:07:58 +0200
commit967be9e750221ab2ab783f95df79bb26d290a45e (patch)
tree6802900a5e975f9f68b169f0f503f040056d6952 /tiger-compiler/src/overload/type-checker.hh
add: added projectsHEADmain
Diffstat (limited to 'tiger-compiler/src/overload/type-checker.hh')
-rw-r--r--tiger-compiler/src/overload/type-checker.hh37
1 files changed, 37 insertions, 0 deletions
diff --git a/tiger-compiler/src/overload/type-checker.hh b/tiger-compiler/src/overload/type-checker.hh
new file mode 100644
index 0000000..719db72
--- /dev/null
+++ b/tiger-compiler/src/overload/type-checker.hh
@@ -0,0 +1,37 @@
+/**
+ ** \file overload/type-checker.hh
+ ** \brief Checking/translating an OverTiger program in a Tiger program.
+ */
+
+#pragma once
+
+#include <overload/binder.hh>
+#include <type/type-checker.hh>
+#include <type/types.hh>
+
+namespace overload
+{
+ /** \brief Perform type checking, allowing function overload, and compute
+ ** the bindings of the functions.
+ **
+ ** Inheritance is declared virtual to enable diamond inheritance with
+ ** the combine::TypeChecker (src/combine/type-checker.hh), inheriting
+ ** from overload::TypeChecker and object::TypeChecker, both inheriting from
+ ** type::TypeChecker.
+ **/
+ class TypeChecker : virtual public type::TypeChecker
+ {
+ public:
+ /// Superclass.
+ using super_type = type::TypeChecker;
+ using super_type::operator();
+
+ TypeChecker(const overfun_bindings_type& overfun_bindings);
+ virtual ~TypeChecker() = default;
+
+ // FIXME: Some code was deleted here.
+ private:
+ const overfun_bindings_type& overfun_bindings_;
+ };
+
+} // namespace overload