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

ChAoS_UnItY 2022-06-07 06:29:27 +08:00 committed by Chewing_Bever
parent 24ae92cd0d
commit 3ceadec7ad
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
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
}
}
} 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' {

View File

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

View File

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