autofree: make optional methods work
parent
f337980e52
commit
fc88f43e50
|
@ -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)}*/')
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue