diff --git a/src/macro/Environment.cc b/src/macro/Environment.cc
index 8815588c98a1f85b6c20a321e16cd05fe8c3019a..76e34ab7ba5ab9435106979950b4f2cbef9521c0 100644
--- a/src/macro/Environment.cc
+++ b/src/macro/Environment.cc
@@ -67,7 +67,7 @@ Environment::getFunction(const string &name) const
 }
 
 codes::BaseType
-Environment::getType(const string &name)
+Environment::getType(const string &name) const
 {
   return getVariable(name)->eval()->getType();
 }
diff --git a/src/macro/Environment.hh b/src/macro/Environment.hh
index 231b245d8d0b4ad2fb87b2f35c8c3c059976a255..7c4bed3faa81fea83c709723df95aa594d58fda2 100644
--- a/src/macro/Environment.hh
+++ b/src/macro/Environment.hh
@@ -40,7 +40,7 @@ namespace macro
     void define(FunctionPtr func, ExpressionPtr value);
     ExpressionPtr getVariable(const string &name) const;
     tuple<FunctionPtr, ExpressionPtr> getFunction(const string &name) const;
-    codes::BaseType getType(const string &name);
+    codes::BaseType getType(const string &name) const;
     bool isVariableDefined(const string &name) const noexcept;
     bool isFunctionDefined(const string &name) const noexcept;
     inline bool isSymbolDefined(const string &name) const noexcept { return isVariableDefined(name) || isFunctionDefined(name); }