diff options
Diffstat (limited to '030container.cc')
-rw-r--r-- | 030container.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/030container.cc b/030container.cc index 4a6ad1d2..bc421ac6 100644 --- a/030container.cc +++ b/030container.cc @@ -191,6 +191,7 @@ void compute_container_sizes(recipe_ordinal r) { } void compute_container_sizes(reagent& r) { + expand_type_abbreviations(r.type); if (is_literal(r) || is_dummy(r)) return; reagent rcopy = r; // Compute Container Size(reagent rcopy) @@ -297,6 +298,19 @@ void test_container_sizes() { CHECK_EQ(get(Container_metadata, r.type).size, 2); } +void test_container_sizes_through_aliases() { + // a new alias for a container + put(Type_abbreviations, "pt", new_type_tree("point")); + reagent r("x:pt"); + // scan + compute_container_sizes(r); + // the reagent we scanned knows its size + CHECK_EQ(r.metadata.size, 2); + // the global table also knows its size + CHECK(contains_key(Container_metadata, r.type)); + CHECK_EQ(get(Container_metadata, r.type).size, 2); +} + void test_container_sizes_nested() { // a container we don't have the size for reagent r("x:point-number"); |