Fix associative op const-value calculation

This commit is contained in:
Nigel Tao committed 2020-02-08 14:54:00 +11:00
1 parent 8d29cb15ce
commit fb9a0964a2
4 files changed
+84 -9

No files matched your search

+7 -3
View File
@@ -749,10 +749,14 @@ func nodeDebugString(tm *t.Map, n *a.Node) string {
func allTypeChecked(tm *t.Map, n *a.Node) error {
return n.Walk(func(o *a.Node) error {
b := o.MBounds()
if b := o.MBounds(); (b[0] == nil) || (b[1] == nil) {
return fmt.Errorf("check: internal error: unchecked %s (missing bounds)",
nodeDebugString(tm, o))
}
typ := o.MType()
if b[0] == nil || b[1] == nil || typ == nil {
return fmt.Errorf("check: internal error: unchecked %s", nodeDebugString(tm, o))
if typ == nil {
return fmt.Errorf("check: internal error: unchecked %s (missing type)",
nodeDebugString(tm, o))
}
typOK := false