diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-06-25 13:36:27 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-06-25 13:36:27 -0700 |
commit | 2caaa7f18f391995feae550c59fa175af86b6817 (patch) | |
tree | ffe03071ec5be2033c904e1a4e55d6973c5c8d2b /011load.cc | |
parent | b0631dec20089bb142be2ccf28438ebe09489ce5 (diff) | |
download | mu-2caaa7f18f391995feae550c59fa175af86b6817.tar.gz |
4272 - type-check variables in non-local spaces
So far we only checked if a single recipe used a variable with multiple types in any single space. Now we also ensure that the types deduced for a variable in a space are identical across recipes.
Diffstat (limited to '011load.cc')
-rw-r--r-- | 011load.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/011load.cc b/011load.cc index 8eec19a0..666f1c6e 100644 --- a/011load.cc +++ b/011load.cc @@ -65,7 +65,9 @@ int slurp_recipe(istream& in) { raise << "empty result.name\n" << end(); trace(9991, "parse") << "--- defining " << result.name << end(); if (!contains_key(Recipe_ordinal, result.name)) - put(Recipe_ordinal, result.name, Next_recipe_ordinal++); + put(Recipe_ordinal, result.name, Next_recipe_ordinal); + result.ordinal = get(Recipe_ordinal, result.name); + ++Next_recipe_ordinal; if (Recipe.find(get(Recipe_ordinal, result.name)) != Recipe.end()) { trace(9991, "parse") << "already exists" << end(); if (should_check_for_redefine(result.name)) |