diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-09-11 17:54:47 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-09-11 17:54:47 -0700 |
commit | f7f40d32b023751bb34c3a5508b48edfb4eae18a (patch) | |
tree | 6606bc9fe299c443d24014a5eb4030f598545636 | |
parent | 621c64b538500528e4d95b32888a0eaf5dffeec8 (diff) | |
download | mu-f7f40d32b023751bb34c3a5508b48edfb4eae18a.tar.gz |
3326
-rw-r--r-- | 018type_abbreviations.cc | 8 |
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. |