From 2caaa7f18f391995feae550c59fa175af86b6817 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 25 Jun 2018 13:36:27 -0700 Subject: 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. --- 011load.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '011load.cc') 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)) -- cgit 1.4.1-2-gfad0