diff --git a/include/bolt/Checker.hpp b/include/bolt/Checker.hpp index d551ff24d..98d2917cf 100644 --- a/include/bolt/Checker.hpp +++ b/include/bolt/Checker.hpp @@ -138,24 +138,9 @@ namespace bolt { }; - enum { - /** - * Indicates that the typing environment of the current context will not - * hold on to any bindings. - * - * Concretely, bindings that are assigned fall through to the parent - * context, where this process is repeated until an environment is found - * that is not pervious. - */ - InferContextFlags_PerviousEnv = 1 << 0, - }; - using InferContextFlagsMask = unsigned; class InferContext { - - InferContextFlagsMask Flags = 0; - public: /** @@ -173,18 +158,6 @@ namespace bolt { Type* ReturnType = nullptr; std::vector Classes; - inline void setIsEnvPervious(bool Enable) noexcept { - if (Enable) { - Flags |= InferContextFlags_PerviousEnv; - } else { - Flags &= ~InferContextFlags_PerviousEnv; - } - } - - inline bool isEnvPervious() const noexcept { - return Flags & InferContextFlags_PerviousEnv; - } - //inline InferContext(InferContext* Parent, TVSet& TVs, ConstraintSet& Constraints, TypeEnv& Env, Type* ReturnType): // Parent(Parent), TVs(TVs), Constraints(Constraints), Env(Env), ReturnType(ReturnType) {} diff --git a/src/Checker.cc b/src/Checker.cc index 4beb92297..af53b4ac2 100644 --- a/src/Checker.cc +++ b/src/Checker.cc @@ -86,14 +86,7 @@ namespace bolt { } void Checker::addBinding(ByteString Name, Scheme* Scm) { - for (auto Iter = Contexts.rbegin(); Iter != Contexts.rend(); Iter++) { - auto& Ctx = **Iter; - if (!Ctx.isEnvPervious()) { - Ctx.Env.emplace(Name, Scm); - return; - } - } - ZEN_UNREACHABLE + Contexts.back()->Env.emplace(Name, Scm); } Type* Checker::getReturnType() {