mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
15 lines
196 B
V
15 lines
196 B
V
struct Foo {
|
|
text string = $if linux {
|
|
'linux'
|
|
} $else {
|
|
println('else')
|
|
'else'
|
|
}
|
|
}
|
|
|
|
fn test_comptime_if_expr_in_struct_field_default() {
|
|
f := Foo{}
|
|
println(f)
|
|
assert f.text.len > 0
|
|
}
|