Added NOTREACHED.

This commit is contained in:
yhirose 2015-06-02 14:21:43 -04:00
parent f8da5085aa
commit 2b734978d1

View File

@ -188,15 +188,19 @@ struct Environment
Value get(const std::string& s) const { Value get(const std::string& s) const {
assert(has(s)); assert(has(s));
if (dic_.find(s) != dic_.end()) { if (dic_.find(s) != dic_.end()) {
return dic_.at(s); return dic_.at(s);
} }
for (auto& outer: outers_) { for (auto& outer: outers_) {
if (outer->has(s)) { if (outer->has(s)) {
return outer->get(s); return outer->get(s);
} }
} }
// NOT REACHED
// NOTREACHED
throw std::logic_error("invalid internal condition.");
} }
void set(const std::string& s, const Value& val) { void set(const std::string& s, const Value& val) {