summaryrefslogtreecommitdiff
path: root/type-check.c
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2007-10-17 02:04:39 -0400
committerSøren Sandmann <sandmann@redhat.com>2007-10-17 02:04:39 -0400
commitaf2c5e716c246bbd7ce7091b7af5b5230e27c366 (patch)
tree601eafa924c23be39e8b284d452f932196b81fa1 /type-check.c
parent3f67e685baac1166bb5b053d20cfca9d22a238de (diff)
Allow general types with new
Diffstat (limited to 'type-check.c')
-rw-r--r--type-check.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/type-check.c b/type-check.c
index 8f0a5fc..ee954e5 100644
--- a/type-check.c
+++ b/type-check.c
@@ -691,9 +691,9 @@ type_check_expression (ast_expression_t *expr)
return FALSE;
}
- if (expr->new.definition->common.type != AST_CLASS_DEFINITION)
+ if (!is_class (expr->new.type) && !is_array (expr->new.type))
{
- g_print ("%s is not a class\n", expr->new.type_name);
+ g_print ("Type is not class or array\n");
return FALSE;
}
@@ -704,7 +704,7 @@ type_check_expression (ast_expression_t *expr)
return FALSE;
}
- expr->common.type_spec = expr->new.definition->class.type_spec;
+ expr->common.type_spec = expr->new.type;
break;
case AST_DOT_EXPRESSION: