From f7f40d32b023751bb34c3a5508b48edfb4eae18a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 11 Sep 2016 17:54:47 -0700 Subject: 3326 --- 018type_abbreviations.cc | 8 ++++++++ 1 file changed, 8 insertions(+) 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. -- cgit 1.4.1-2-gfad0