about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-17 10:24:56 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-17 10:24:56 -0700
commite24799ead45d9d4a86d8e8ab051dd16e1e417431 (patch)
tree0e1ea38fc9f1cc5e9603c6900c28c22f08dea30e
parent97cf12b19e2f6bd754027e25b768f6dad1c3d587 (diff)
downloadmu-e24799ead45d9d4a86d8e8ab051dd16e1e417431.tar.gz
3384
-rw-r--r--030container.cc14
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");