-70ca85f08edf63f46c87d540fa99c45e2903edc2
+fbadca004b1e09db177c8e071706841038d1dd64
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Location location = this->location();
Unordered_map(unsigned int, std::vector<Expression*>) st;
Unordered_map(unsigned int, std::vector<Expression*>) nt;
+ bool saw_false = false;
+ bool saw_true = false;
if (this->vals_ != NULL)
{
if (!this->has_keys_)
continue;
std::string sval;
Numeric_constant nval;
+ bool bval;
if ((*p)->string_constant_value(&sval)) // Check string keys.
{
unsigned int h = Gogo::hash_string(sval, 0);
mit->second.push_back(*p);
}
}
+ else if ((*p)->boolean_constant_value(&bval))
+ {
+ if ((bval && saw_true) || (!bval && saw_false))
+ {
+ go_error_at((*p)->location(),
+ "duplicate key in map literal");
+ return Expression::make_error(location);
+ }
+ if (bval)
+ saw_true = true;
+ else
+ saw_false = true;
+ }
}
}