Drop the "= RHS" out of "var x T = RHS"

This commit is contained in:
Nigel Tao committed 2018-12-27 11:29:47 +11:00
1 parent cbe19f50e0
commit 6dc68950c0
7 files changed
+20 -68

No files matched your search

+1 -13
View File
@@ -193,19 +193,7 @@ func (q *checker) tcheckStatement(n *a.Node) error {
if n.XType().AsNode().MType() == nil {
return fmt.Errorf("check: internal error: unchecked type expression %q", n.XType().Str(q.tm))
}
if value := n.Value(); value != nil {
if err := q.tcheckExpr(value, 0); err != nil {
return err
}
lTyp := n.XType()
rTyp := value.MType()
if err := q.tcheckEq(n.Name(), nil, lTyp, value, rTyp); err != nil {
return err
}
} else {
// TODO: check that the default zero value is assignable to n.XType().
}
// TODO: check that the default zero value is assignable to n.XType().
case a.KWhile:
n := n.AsWhile()