about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-01-13 23:20:30 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-01-13 23:20:30 -0800
commit3063b2393aa1f76acdf59736649997da8a21bd84 (patch)
treeee207363878b19187eb523229e20c258ff239ea4
parent802283e450b7a8b14b1730358ecb9473ef074147 (diff)
downloadmu-3063b2393aa1f76acdf59736649997da8a21bd84.tar.gz
2560
-rw-r--r--048check_type_by_name.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/048check_type_by_name.cc b/048check_type_by_name.cc
index ea4bcba2..4842e15c 100644
--- a/048check_type_by_name.cc
+++ b/048check_type_by_name.cc
@@ -47,16 +47,14 @@ void deduce_missing_type(map<string, type_tree*>& type, map<string, string_tree*
 
 void check_type(map<string, type_tree*>& type, map<string, string_tree*>& type_name, const reagent& x, const recipe_ordinal r) {
   if (is_literal(x)) return;
-  // 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 (is_integer(x.name)) return;  // if you use raw locations you're probably doing something unsafe
+  if (!x.type) return;  // might get filled in by other logic later
   if (!contains_key(type, x.name)) {
     trace(9992, "transform") << x.name << " => " << debug_string(x.type) << end();
     type[x.name] = x.type;
   }
-  if (!contains_key(type_name, x.name)) {
+  if (!contains_key(type_name, x.name))
     type_name[x.name] = x.properties.at(0).second;
-  }
   if (!types_strictly_match(type[x.name], x.type))
     raise_error << maybe(get(Recipe, r).name) << x.name << " used with multiple types\n" << end();
 }
='n152' href='#n152'>152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 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