autofree: make optional methods work

pull/6357/head
Alexander Medvednikov 2020-09-13 03:20:34 +02:00
parent f337980e52
commit fc88f43e50
2 changed files with 1 additions and 2 deletions

View File

@ -419,6 +419,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
} }
} }
} }
g.generate_tmp_autofree_arg_vars(node, name)
// if node.receiver_type != 0 { // if node.receiver_type != 0 {
// g.write('/*${g.typ(node.receiver_type)}*/') // g.write('/*${g.typ(node.receiver_type)}*/')
// g.write('/*expr_type=${g.typ(node.left_type)} rec type=${g.typ(node.receiver_type)}*/') // g.write('/*expr_type=${g.typ(node.left_type)} rec type=${g.typ(node.receiver_type)}*/')

View File

@ -79,13 +79,11 @@ fn optional_str() {
} }
println(pos2 + 1) println(pos2 + 1)
// optional method args must be freed // optional method args must be freed
/*
pos := s.index('query: $q') or { pos := s.index('query: $q') or {
println('exiting') println('exiting')
return return
} }
println(pos + 1) println(pos + 1)
*/
} }
fn main() { fn main() {