diff --git a/src/kernel/environment.cpp b/src/kernel/environment.cpp index ebe9a9dca..e99a65b67 100644 --- a/src/kernel/environment.cpp +++ b/src/kernel/environment.cpp @@ -4,6 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ +#include +#include #include #include "kernel/environment.h" #include "kernel/kernel_exception.h" @@ -58,10 +60,10 @@ optional environment::find(name const & n) const { } definition environment::get(name const & n) const { - definition const * r = m_definitions.find(n); - if (!r) - throw_unknown_declaration(*this, n); - return *r; + definition const * r = m_definitions.find(n); + if (!r) + throw_unknown_declaration(*this, n); + return *r; } [[ noreturn ]] void throw_incompatible_environment(environment const & env) { diff --git a/src/kernel/environment.h b/src/kernel/environment.h index 5766ac30e..6e522c98b 100644 --- a/src/kernel/environment.h +++ b/src/kernel/environment.h @@ -7,6 +7,7 @@ Author: Leonardo de Moura #pragma once #include #include +#include #include "util/rc.h" #include "util/optional.h" #include "util/list.h"