diff options
author | Søren Sandmann <sandmann@redhat.com> | 2007-10-17 02:04:39 -0400 |
---|---|---|
committer | Søren Sandmann <sandmann@redhat.com> | 2007-10-17 02:04:39 -0400 |
commit | af2c5e716c246bbd7ce7091b7af5b5230e27c366 (patch) | |
tree | 601eafa924c23be39e8b284d452f932196b81fa1 /type-check.c | |
parent | 3f67e685baac1166bb5b053d20cfca9d22a238de (diff) |
Allow general types with new
Diffstat (limited to 'type-check.c')
-rw-r--r-- | type-check.c | 6 |
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: |