1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cgen: fix type not being unaliased (fix #14568) (#14591)

This commit is contained in:
ChAoS_UnItY 2022-06-02 11:21:01 +08:00 committed by GitHub
parent 55951e0943
commit a95cdac635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -750,7 +750,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
}
left_is_shared := node.left_type.has_flag(.shared_f)
left_cc_type := g.cc_type(node.left_type, false)
left_cc_type := g.cc_type(g.table.unaliased_type(node.left_type), false)
left_type_name := util.no_dots(left_cc_type)
g.write('${c_name(left_type_name)}_name_table[')
if node.left.is_auto_deref_var() && node.left_type.nr_muls() > 1 {

View File

View File

@ -0,0 +1,9 @@
import io { Reader }
type Decoder = Reader
fn (mut d Decoder) decode(len int) ?[]u8 {
mut buf := []u8{len: len}
d.read(mut buf)?
return buf
}