1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Files
v/vlib/v/fmt/tests/structs_input.vv
2021-06-30 22:30:28 +03:00

66 lines
721 B
V

struct User {
name string // name
name2 []rune // name2
very_long_field bool
age int // age
very_long_type_field1 very_looooog_type // long
very_long_type_field2 very_loooooooong_type // long
}
struct FamousUser {
pub:
User
aka string
}
struct Foo {
field1 int // f1
field2 string // f2
pub:
public_field1 int // f1
public_field2 f64 // f2
mut:
mut_field string
pub mut:
pub_mut_field string
}
struct Bar { Foo }
fn new_user()
User
{
return User{
name: 'Serious Sam'
age: 19
}
}
struct SomeStruct {
// 1
mut:
// 2
// 3
somefield /*4*/ /*5*/ int /*6*/ /*7*/ /*8*/ /*
9
10
*/
somefield2 /*11*/ int // 12
pub:
somefield3 int
somefield4 int
/*
13
14
*/
}
struct C.Foo