Commit cbef5c3e authored by Eric Myhre's avatar Eric Myhre

Fix excessing pointers in maybes.

parent 14e6653c
...@@ -67,11 +67,11 @@ func (g stringGenerator) EmitNativeMaybe(w io.Writer) { ...@@ -67,11 +67,11 @@ func (g stringGenerator) EmitNativeMaybe(w io.Writer) {
func (m Maybe{{ .Type | TypeSymbol }}) Exists() bool { func (m Maybe{{ .Type | TypeSymbol }}) Exists() bool {
return m.m == schema.Maybe_Value return m.m == schema.Maybe_Value
} }
func (m Maybe{{ .Type | TypeSymbol }}) Must() *{{ .Type | TypeSymbol }} { func (m Maybe{{ .Type | TypeSymbol }}) Must() {{ .Type | TypeSymbol }} {
if !m.Exists() { if !m.Exists() {
panic("unbox of a maybe rejected") panic("unbox of a maybe rejected")
} }
return &m.n return m.n
} }
`, w, g.AdjCfg, g) `, w, g.AdjCfg, g)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment