mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
autofree: make optional methods work
This commit is contained in:
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 {
|
||||
// g.write('/*${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)
|
||||
// optional method args must be freed
|
||||
/*
|
||||
pos := s.index('query: $q') or {
|
||||
println('exiting')
|
||||
return
|
||||
}
|
||||
println(pos + 1)
|
||||
*/
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user