Change iterate variable types from ptr to slice

This commit is contained in:
Nigel Tao committed 2018-05-04 13:20:34 +10:00
1 parent d85a94360e
commit 96a549814d
8 files changed
+54 -52

No files matched your search

+2 -4
View File
@@ -304,8 +304,7 @@ func (q *checker) bcheckStatement(n *a.Node) error {
q.facts = q.facts[:0]
for _, o := range n.Variables() {
v := o.Var()
// TODO: use the XType(), not the Value().MType().
q.facts = append(q.facts, makeSliceLengthEqEq(v.Name(), v.Value().MType(), n.Step()))
q.facts = append(q.facts, makeSliceLengthEqEq(v.Name(), v.XType(), n.Step()))
}
for _, o := range n.Body() {
if err := q.bcheckStatement(o); err != nil {
@@ -319,8 +318,7 @@ func (q *checker) bcheckStatement(n *a.Node) error {
q.facts = q.facts[:0]
for _, o := range n.Variables() {
v := o.Var()
// TODO: use the XType(), not the Value().MType().
q.facts = append(q.facts, makeSliceLengthEqEq(v.Name(), v.Value().MType(), t.ID1))
q.facts = append(q.facts, makeSliceLengthEqEq(v.Name(), v.XType(), t.ID1))
}
for _, o := range n.Tail() {
if err := q.bcheckStatement(o); err != nil {