examples: add sum example (its not pretty)

This commit is contained in:
Michael McLoughlin
2018-12-11 23:02:50 -08:00
parent 19d1761694
commit 2189d38d1e
6 changed files with 71 additions and 4 deletions

View File

@@ -126,12 +126,11 @@ func (c *component) Index(i int) Component {
}
func (c *component) sub(suffix string, offset int, t types.Type) *component {
var s *component
*s = *c
s := *c
s.name += suffix
s.offset += offset
s.typ = t
return s
return &s
}
// TODO(mbm): gotypes.Component handling for structs