mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix none literal str() function calling (#14704)
This commit is contained in:
parent
abf35270cf
commit
73b59c7b16
@ -928,6 +928,10 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
|
||||
return
|
||||
}
|
||||
}
|
||||
} else if node.left is ast.None {
|
||||
// none.str()
|
||||
g.gen_expr_to_string(node.left, ast.none_type)
|
||||
return
|
||||
}
|
||||
g.get_str_fn(rec_type)
|
||||
} else if node.name == 'free' {
|
||||
|
1
vlib/v/gen/c/testdata/none_literal_str.out
vendored
Normal file
1
vlib/v/gen/c/testdata/none_literal_str.out
vendored
Normal file
@ -0,0 +1 @@
|
||||
<none>
|
1
vlib/v/gen/c/testdata/none_literal_str.vv
vendored
Normal file
1
vlib/v/gen/c/testdata/none_literal_str.vv
vendored
Normal file
@ -0,0 +1 @@
|
||||
println(none.str())
|
Loading…
Reference in New Issue
Block a user