insert_container is getting pretty gnarly. It's spread across two layers
(containers and shape-shifting containers), and since it has to deal
with extending existing containers it's coiled in on itself,
constantly reading and writing the Type table.

Maybe I should uncoil the case of extending a container and make it
separate from defining a new container.
This commit is contained in:
Kartik K. Agaram 2016-05-25 22:18:45 -07:00
parent f8b56b793d
commit c78bc9bde9
1 changed files with 2 additions and 2 deletions

View File

@ -111,9 +111,9 @@ bool read_type_ingredients(string& name, const string& command) {
}
if (contains_key(Type_ordinal, name)
&& contains_key(Type, get(Type_ordinal, name))) {
const type_info& info = get(Type, get(Type_ordinal, name));
const type_info& previous_info = get(Type, get(Type_ordinal, name));
// we've already seen this container; make sure type ingredients match
if (!type_ingredients_match(type_ingredient_names, info.type_ingredient_names)) {
if (!type_ingredients_match(type_ingredient_names, previous_info.type_ingredient_names)) {
raise << "headers of " << command << " '" << name << "' must use identical type ingredients\n" << end();
return false;
}