about summary refs log tree commit diff stats
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
parentc6354606d412b7719ab7078b59c015d580520bde (diff)
downloadmu-5967e82fab9feea381dd1b6e1925177e771d86dc.tar.gz
2457
-rw-r--r--030container.cc7
-rw-r--r--048check_type_by_name.cc2
-rw-r--r--058shape_shifting_container.cc8
3 files changed, 6 insertions, 11 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);
diff --git a/048check_type_by_name.cc b/048check_type_by_name.cc
index 093b7d09..a481b2f4 100644
--- a/048check_type_by_name.cc
+++ b/048check_type_by_name.cc
@@ -95,4 +95,4 @@ recipe main [
   y:address:charcter <- new character:type
   *y <- copy 67
 ]
-+error: main: unknown type in 'y:address:charcter <- new character:type'
++error: main: unknown type charcter in 'y:address:charcter <- new character:type'
diff --git a/058shape_shifting_container.cc b/058shape_shifting_container.cc
index c7bc38ac..6416aca1 100644
--- a/058shape_shifting_container.cc
+++ b/058shape_shifting_container.cc
@@ -95,13 +95,7 @@ long long int size_of_type_ingredient(const type_tree* element_template, const t
   }
   assert(curr);
   assert(!curr->left);  // unimplemented
-  if (!contains_key(Type, curr->value)) {
-    // temporarily while we're still ironing out kinks; eventually replace with a raise_error
-//?     DUMP("");
-    cerr << "missing type " << debug_string(curr) << '\n';
-    exit(0);
-  }
-  assert(contains_key(Type, curr->value));
+  if (!contains_key(Type, curr->value)) return 0;
   trace(9999, "type") << "type deduced to be " << get(Type, curr->value).name << "$" << end();
   type_tree tmp(curr->value);
   if (curr->right)