Fix bug where templated methods (and maybe objects) were always having their bodies instantiated

This commit is contained in:
Nathan Braswell
2016-02-24 03:51:50 -05:00
parent c2f0c0d583
commit a733bd0dfa

View File

@@ -191,9 +191,12 @@ obj ast_transformation (Object) {
ast_node::type_def(backing) {
// make sure not a template? or the method not a template?
// also same body problem as below
node->type_def.methods.for_each(fun(method: *ast_node) {
method->function.body_statement = transform_statement(get_node("statement", ast_to_syntax[method]), method, map<string, *type>())
})
if (!is_template(node)) {
node->type_def.methods.for_each(fun(method: *ast_node) {
if (!is_template(method))
method->function.body_statement = transform_statement(get_node("statement", ast_to_syntax[method]), method, map<string, *type>())
})
}
}
ast_node::function(backing) {
// make sure not a template