about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-27 09:10:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-27 09:10:38 -0700
commit91f220ae692490ab182bf493857e912c4a977cf4 (patch)
tree93c60ea1f5d87b5e4ab9be68197853ae45471484
parent5a26c015a4218f10316ecad7f9cb794d8f12f3d5 (diff)
downloadmu-91f220ae692490ab182bf493857e912c4a977cf4.tar.gz
3598 - 'use before set' errors were too cryptic
-rw-r--r--042name.cc4
-rw-r--r--053recipe_header.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/042name.cc b/042name.cc
index fbfa5d20..1fd559e8 100644
--- a/042name.cc
+++ b/042name.cc
@@ -15,7 +15,7 @@ def main [
 def main [
   x:num <- copy y:num
 ]
-+error: main: use before set: 'y'
++error: main: tried to read ingredient 'y' in 'x:num <- copy y:num' but it hasn't been written to yet
 # todo: detect conditional defines
 
 :(after "Transform.push_back(compute_container_sizes)")
@@ -55,7 +55,7 @@ void transform_names(const recipe_ordinal r) {
       if (is_named_location(ingredient)) names_used = true;
       if (is_integer(ingredient.name)) continue;
       if (!already_transformed(ingredient, names)) {
-        raise << maybe(caller.name) << "use before set: '" << ingredient.name << "'\n" << end();
+        raise << maybe(caller.name) << "tried to read ingredient '" << ingredient.name << "' in '" << to_original_string(inst) << "' but it hasn't been written to yet\n" << end();
         // use-before-set Error
         return;
       }
diff --git a/053recipe_header.cc b/053recipe_header.cc
index 87b018c8..75b50b89 100644
--- a/053recipe_header.cc
+++ b/053recipe_header.cc
@@ -228,7 +228,7 @@ def foo a:num [
   local-scope
   b:num <- add a:num, 1
 ]
-+error: foo: use before set: 'a'
++error: foo: tried to read ingredient 'a' in 'b:num <- add a:num, 1' but it hasn't been written to yet
 +error:   did you forget 'load-ingredients'?
 
 :(after "use-before-set Error")