about summary refs log tree commit diff stats
path: root/048check_type_by_name.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-01 18:14:18 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-01 18:14:18 -0800
commited09f7384ad87e87e1035b948c7f88841570f292 (patch)
tree0a44bd97bca589f596ac6e816722945db8ffc139 /048check_type_by_name.cc
parent6d79cc137b045ace341f666a67054bdeddef992e (diff)
downloadmu-ed09f7384ad87e87e1035b948c7f88841570f292.tar.gz
2339 - don't let dump_types modify Type
Diffstat (limited to '048check_type_by_name.cc')
-rw-r--r--048check_type_by_name.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/048check_type_by_name.cc b/048check_type_by_name.cc
index fcefbaf6..e526644a 100644
--- a/048check_type_by_name.cc
+++ b/048check_type_by_name.cc
@@ -19,6 +19,7 @@ recipe main [
 
 :(code)
 void check_types_by_name(const recipe_ordinal r) {
+  trace(9991, "transform") << "--- deduce types for recipe " << Recipe[r].name << end();
   map<string, type_tree*> type;
   for (long long int i = 0; i < SIZE(Recipe[r].steps); ++i) {
     instruction& inst = Recipe[r].steps.at(i);
@@ -39,8 +40,10 @@ void check_type(map<string, type_tree*>& type, const reagent& x, const recipe_or
   // if you use raw locations you're probably doing something unsafe
   if (is_integer(x.name)) return;
   if (!x.type) return;  // will throw a more precise error elsewhere
-  if (type.find(x.name) == type.end())
+  if (type.find(x.name) == type.end()) {
+    trace(9992, "transform") << x.name << " => " << dump_types(x) << end();
     type[x.name] = x.type;
+  }
   if (!types_match(type[x.name], x.type))
     raise_error << maybe(Recipe[r].name) << x.name << " used with multiple types\n" << end();
 }