v_scratch/11_structs/anonymous.v

17 lines
277 B
V

struct Book{
author struct {
name string
age int
}
title string
}
pub fn main(){
book := Book{author: struct{name: 'Samantha Black', age: 23}, title: 'Livro'}
assert book.author.name == 'Samantha Black'
assert book.author.age == 23
assert book.title == 'Livro'
}