mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix comptimeselector option propagation (#18092)
This commit is contained in:
@@ -210,12 +210,12 @@ fn (e &Encoder) encode_struct[U](val U, level int, mut wr io.Writer) ! {
|
||||
}
|
||||
|
||||
$if field.typ is ?string {
|
||||
e.encode_string(val.$(field.name) ?.str()#[8..-2], mut wr)!
|
||||
e.encode_string(val.$(field.name) ?.str(), mut wr)!
|
||||
} $else $if field.typ is ?bool || field.typ is ?f32 || field.typ is ?f64
|
||||
|| field.typ is ?i8 || field.typ is ?i16 || field.typ is ?int
|
||||
|| field.typ is ?i64 || field.typ is ?u8 || field.typ is ?u16
|
||||
|| field.typ is ?u32 || field.typ is ?u64 {
|
||||
wr.write(val.$(field.name) ?.str()#[7..-1].bytes())!
|
||||
wr.write(val.$(field.name) ?.str().bytes())!
|
||||
} $else $if field.typ is ?time.Time {
|
||||
option_value := val.$(field.name) as ?time.Time
|
||||
parsed_time := option_value as time.Time
|
||||
|
Reference in New Issue
Block a user