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-10-01 13:13:10 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-01 13:13:10 -0700
commit4814bf94e75ffdcbd2a4093eb1ab67851980a37a (patch)
tree9fde405360c5499fa2ad4b25ca009ed3bcc1f57b /048check_type_by_name.cc
parent5fdd8e96adcf6f572888078caee62adbee1906a4 (diff)
downloadmu-4814bf94e75ffdcbd2a4093eb1ab67851980a37a.tar.gz
2226 - standardize warning format
Always show recipe name where error occurred. But don't show internal
'interactive' name for sandboxes, that's just confusing.

What started out as warnings are now ossifying into errors that halt all
execution. Is this how things went with C and Unix as well?
Diffstat (limited to '048check_type_by_name.cc')
-rw-r--r--048check_type_by_name.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/048check_type_by_name.cc b/048check_type_by_name.cc
index e4b4f6d0..26920057 100644
--- a/048check_type_by_name.cc
+++ b/048check_type_by_name.cc
@@ -12,7 +12,7 @@ recipe main [
   x:number <- copy 1
   x:boolean <- copy 1
 ]
-+warn: x used with multiple types in main
++warn: main: x used with multiple types
 
 :(after "int main")
   Transform.push_back(check_types_by_name);
@@ -42,7 +42,7 @@ void check_metadata(map<string, vector<type_ordinal> >& metadata, const reagent&
   if (metadata.find(x.name) == metadata.end())
     metadata[x.name] = x.types;
   if (metadata[x.name] != x.types)
-    raise << x.name << " used with multiple types in " << Recipe[r].name << '\n' << end();
+    raise << maybe(Recipe[r].name) << "" << x.name << " used with multiple types\n" << end();
 }
 
 :(scenario transform_fills_in_missing_types)
@@ -80,7 +80,7 @@ recipe main [
   x <- copy 1
   x:number <- copy 2
 ]
-+warn: missing type for x in 'x <- copy 1'
++warn: main: missing type for x in 'x <- copy 1'
 
 :(scenario typo_in_address_type_warns)
 % Hide_warnings = true;