summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/overload/type-checker.hh
diff options
context:
space:
mode:
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