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

v.ast: improve Expr.str() for sizeof(Type)

This commit is contained in:
Delyan Angelov 2021-03-19 20:56:49 +02:00
parent 79a8e34e33
commit c5884a5f4d
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -318,6 +318,9 @@ pub fn (x Expr) str() string {
return '${x.expr.str()}.$x.field_name'
}
SizeOf {
if x.is_type {
return 'sizeof(Type($x.typ))'
}
return 'sizeof($x.expr)'
}
OffsetOf {