diff --git a/vlib/v/gen/c/fn.v b/vlib/v/gen/c/fn.v index ee9fc70e4e..1df58817b5 100644 --- a/vlib/v/gen/c/fn.v +++ b/vlib/v/gen/c/fn.v @@ -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' { diff --git a/vlib/v/gen/c/testdata/none_literal_str.out b/vlib/v/gen/c/testdata/none_literal_str.out new file mode 100644 index 0000000000..21a1f94ca8 --- /dev/null +++ b/vlib/v/gen/c/testdata/none_literal_str.out @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/vlib/v/gen/c/testdata/none_literal_str.vv b/vlib/v/gen/c/testdata/none_literal_str.vv new file mode 100644 index 0000000000..599f4c354b --- /dev/null +++ b/vlib/v/gen/c/testdata/none_literal_str.vv @@ -0,0 +1 @@ +println(none.str())