mirror of
https://github.com/sbrow/thor.git
synced 2026-08-26 11:23:32 -04:00
feat: page prop now falls through (implicit access).
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import "core:fmt"
|
||||
|
||||
Ctx :: struct {
|
||||
title: string,
|
||||
using page: Page,
|
||||
site: Site,
|
||||
}
|
||||
|
||||
Page :: struct {
|
||||
title: string,
|
||||
}
|
||||
|
||||
Site :: struct {
|
||||
title: string,
|
||||
}
|
||||
|
||||
main :: proc() {
|
||||
site := Ctx {
|
||||
site = Site{title = "foo"},
|
||||
page = Page{title = "bar"},
|
||||
}
|
||||
|
||||
fmt.printfln("%+v", site)
|
||||
fmt.printf("%+v", site)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user