cgen: cleanup, use expected_is_ptr instead of calling .is_ptr() again (#19836)

This commit is contained in:
Turiiya 2023-11-13 12:02:31 +01:00 committed by GitHub
parent 999328a136
commit bcc2bfad15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2537,7 +2537,7 @@ fn (mut g Gen) expr_with_cast(expr ast.Expr, got_type_raw ast.Type, expected_typ
g.writeln('}, sizeof(${shared_styp}))') g.writeln('}, sizeof(${shared_styp}))')
return return
} else if got_type_raw.has_flag(.shared_f) && !expected_type.has_flag(.shared_f) { } else if got_type_raw.has_flag(.shared_f) && !expected_type.has_flag(.shared_f) {
if expected_type.is_ptr() { if expected_is_ptr {
g.write('&') g.write('&')
} }
g.expr(expr) g.expr(expr)