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:
@ -318,6 +318,9 @@ pub fn (x Expr) str() string {
|
|||||||
return '${x.expr.str()}.$x.field_name'
|
return '${x.expr.str()}.$x.field_name'
|
||||||
}
|
}
|
||||||
SizeOf {
|
SizeOf {
|
||||||
|
if x.is_type {
|
||||||
|
return 'sizeof(Type($x.typ))'
|
||||||
|
}
|
||||||
return 'sizeof($x.expr)'
|
return 'sizeof($x.expr)'
|
||||||
}
|
}
|
||||||
OffsetOf {
|
OffsetOf {
|
||||||
|
Reference in New Issue
Block a user