Handle structs that contain structs.

This commit is contained in:
Nigel Tao committed 2017-06-15 15:19:41 +10:00
1 parent b3c12e05cf
commit 86c6b79e1a
9 files changed
+263 -96

No files matched your search

+2 -3
View File
@@ -127,9 +127,8 @@ func invert(tm *t.Map, n *a.Expr) (*a.Expr, error) {
}
func bcheckField(tm *t.Map, n *a.Field) error {
x := n.XType()
for ; x.Inner() != nil; x = x.Inner() {
}
// TODO: check if x is a numeric type? What if n.XType() is "ptr T"?
x := n.XType().Innermost()
dv, nMin, nMax := zero, zero, zero
if o := n.DefaultValue(); o != nil {
dv = o.ConstValue()