Change ADTs to generate a copy_construct() that returns this, which should be our new default. Fix storing functions in vectors (lots of bugs here, with funciton types in templates, sizeof, returned by ref, etc. might have missed a few more, put in some warning comments

This commit is contained in:
Nathan Braswell
2018-06-12 23:29:39 -04:00
parent d85f388792
commit 405ee70db8
4 changed files with 30 additions and 7 deletions

View File

@@ -198,7 +198,7 @@ obj ast_transformation (Object) {
type_ptr(vec<*type>(), node->adt_def.self_type->clone_with_increased_indirection(), 0, false, false, true),
vec<*ast_node>(), _ident("this", node->adt_def.self_type->clone_with_indirection(1), node), false, false)),
make_pair("copy_construct", _function(str("copy_construct"),
type_ptr(vec(copy_construct_param->identifier.type), type_ptr(base_type::void_return()), 0, false, false, true),
type_ptr(vec(copy_construct_param->identifier.type), node->adt_def.self_type->clone_with_increased_indirection(), 0, false, false, true),
vec(copy_construct_param), _ident("this", node->adt_def.self_type->clone_with_indirection(1), node), false, false)),
make_pair("operator=", _function(str("operator="),
type_ptr(vec(assign_param->identifier.type), type_ptr(base_type::void_return()), 0, false, false, true),