about summary refs log tree commit diff stats
path: root/057static_dispatch.cc
diff options
context:
space:
mode:
Diffstat (limited to '057static_dispatch.cc')
-rw-r--r--057static_dispatch.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/057static_dispatch.cc b/057static_dispatch.cc
index 54da5354..6ca6ca7c 100644
--- a/057static_dispatch.cc
+++ b/057static_dispatch.cc
@@ -32,6 +32,7 @@ for (map<string, vector<recipe_ordinal> >::iterator p = Recipe_variants.begin();
 :(before "End Load Recipe Header(result)")
 if (contains_key(Recipe_ordinal, result.name)) {
   const recipe_ordinal r = get(Recipe_ordinal, result.name);
+//?   if (variant_already_exists(result)) cerr << "AAAAAAAAAAAAAAAAAA variant already exists " << result.name << '\n';
   if ((!contains_key(Recipe, r) || get(Recipe, r).has_header)
       && !variant_already_exists(result)) {
     string new_name = next_unused_recipe_name(result.name);
@@ -62,12 +63,16 @@ bool all_reagents_match(const recipe& r1, const recipe& r2) {
   if (SIZE(r1.ingredients) != SIZE(r2.ingredients)) return false;
   if (SIZE(r1.products) != SIZE(r2.products)) return false;
   for (long long int i = 0; i < SIZE(r1.ingredients); ++i) {
-    if (!exact_match(r1.ingredients.at(i).type, r2.ingredients.at(i).type))
+    if (!deeply_equal_types(r1.ingredients.at(i).properties.at(0).second,
+                            r2.ingredients.at(i).properties.at(0).second)) {
       return false;
+    }
   }
   for (long long int i = 0; i < SIZE(r1.products); ++i) {
-    if (!exact_match(r1.products.at(i).type, r2.products.at(i).type))
+    if (!deeply_equal_types(r1.products.at(i).properties.at(0).second,
+                            r2.products.at(i).properties.at(0).second)) {
       return false;
+    }
   }
   return true;
 }
@@ -119,6 +124,7 @@ void resolve_ambiguous_calls(recipe_ordinal r) {
     assert(!get(Recipe_variants, inst.name).empty());
     replace_best_variant(inst, caller_recipe);
   }
+//?   if (caller_recipe.name == "main") cerr << "=============== " << debug_string(caller_recipe) << '\n';
 }
 
 void replace_best_variant(instruction& inst, const recipe& caller_recipe) {
f='#n174'>174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280