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

ci: fix comptime_concrete_type_register_test.v after 9a9cfe4 (#17744)

This commit is contained in:
yuyi 2023-03-23 22:42:35 +08:00 committed by GitHub
parent 9a9cfe425c
commit 6b5c746146
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,7 @@ mut:
fn encode_struct[U](val U) ! { fn encode_struct[U](val U) ! {
$for field in U.fields { $for field in U.fields {
$if field.typ is $Map { $if field.typ is $map {
for _, v in val.$(field.name) { for _, v in val.$(field.name) {
encode_value_with_level(v)! encode_value_with_level(v)!
} }
@ -16,10 +16,10 @@ fn encode_struct[U](val U) ! {
} }
fn encode_value_with_level[T](val T) ! { fn encode_value_with_level[T](val T) ! {
$if T is $Struct { $if T is $struct {
dump(val) dump(val)
println(encode_struct(val)!) println(encode_struct(val)!)
} $else $if T is $Map { } $else $if T is $map {
dump(val) dump(val)
} $else $if T is string { } $else $if T is string {
dump(val) dump(val)
@ -28,7 +28,7 @@ fn encode_value_with_level[T](val T) ! {
fn (e &Encoder) encode_struct[U](val U) ! { fn (e &Encoder) encode_struct[U](val U) ! {
$for field in U.fields { $for field in U.fields {
$if field.typ is $Map { $if field.typ is $map {
for _, v in val.$(field.name) { for _, v in val.$(field.name) {
e.encode_value_with_level(v)! e.encode_value_with_level(v)!
} }
@ -37,10 +37,10 @@ fn (e &Encoder) encode_struct[U](val U) ! {
} }
fn (e &Encoder) encode_value_with_level[T](val T) ! { fn (e &Encoder) encode_value_with_level[T](val T) ! {
$if T is $Struct { $if T is $struct {
dump(val) dump(val)
println(e.encode_struct(val)!) println(e.encode_struct(val)!)
} $else $if T is $Map { } $else $if T is $map {
dump(val) dump(val)
} $else $if T is string { } $else $if T is string {
dump(val) dump(val)