about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--018type_abbreviations.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/018type_abbreviations.cc b/018type_abbreviations.cc
index 1fc0f432..60044a28 100644
--- a/018type_abbreviations.cc
+++ b/018type_abbreviations.cc
@@ -72,6 +72,7 @@ type_tree* new_type_tree(const string& x) {
   string_tree* type_names = starts_with(x, "(") ? parse_string_tree(x) : parse_string_list(x);
   type_tree* result = new_type_tree(type_names);
   delete type_names;
+  expand_type_abbreviations(result);
   return result;
 }
 
@@ -118,6 +119,13 @@ put(Type_abbreviations, "num", new type_tree("number"));
 put(Type_abbreviations, "bool", new type_tree("boolean"));
 put(Type_abbreviations, "char", new type_tree("character"));
 
+:(scenario use_type_abbreviations_when_declaring_type_abbreviations)
+type foo = &:num
+def main [
+  a:foo <- copy 0
+]
++run: {a: ("address" "number")} <- copy {0: "literal"}
+
 //:: Expand type aliases before running.
 //: We'll do this in a transform so that we don't need to define abbreviations
 //: before we use them.