cgen: fix none literal str() function calling (#14704)

master
ChAoS_UnItY 2022-06-07 06:29:27 +08:00 committed by GitHub
parent abf35270cf
commit 73b59c7b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -928,6 +928,10 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
return 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) g.get_str_fn(rec_type)
} else if node.name == 'free' { } else if node.name == 'free' {

View File

@ -0,0 +1 @@
<none>

View File

@ -0,0 +1 @@
println(none.str())