about summary refs log tree commit diff stats
path: root/030container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-17 11:28:19 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-17 11:28:19 -0800
commit5967e82fab9feea381dd1b6e1925177e771d86dc (patch)
treea28eb5d3b67a04786e5e2c65231cf0529cbdb240 /030container.cc
parentc6354606d412b7719ab7078b59c015d580520bde (diff)
downloadmu-5967e82fab9feea381dd1b6e1925177e771d86dc.tar.gz
2457
Diffstat (limited to '030container.cc')
-rw-r--r--030container.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/030container.cc b/030container.cc
index 9be42f23..29772b88 100644
--- a/030container.cc
+++ b/030container.cc
@@ -511,7 +511,7 @@ recipe main [
   # integer is not a type
   1:integer <- copy 0
 ]
-+error: main: unknown type in '1:integer <- copy 0'
++error: main: unknown type integer in '1:integer <- copy 0'
 
 :(scenario run_allows_type_definition_after_use)
 % Hide_errors = true;
@@ -522,7 +522,6 @@ recipe main [
 container bar [
   x:number
 ]
--error: unknown type: bar
 $error: 0
 
 :(after "Begin Transforms")
@@ -554,8 +553,10 @@ void check_or_set_invalid_types(type_tree* type, const string_tree* type_name, c
   if (!contains_key(Type, type->value)) {
     if (type_name && contains_key(Type_ordinal, type_name->value))
       type->value = get(Type_ordinal, type_name->value);
+    else if (type_name)
+      raise_error << block << "unknown type " << type_name->value << " in " << name << '\n' << end();
     else
-      raise_error << block << "unknown type in " << name << '\n' << end();
+      raise_error << block << "missing type in " << name << '\n' << end();
   }
   check_or_set_invalid_types(type->left, type_name ? type_name->left : NULL, block, name);
   check_or_set_invalid_types(type->right, type_name ? type_name->right : NULL, block, name);