mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 08:47:56 +01:00
Drop the "= RHS" out of "var x T = RHS"
This commit is contained in:
1 parent
cbe19f50e0
commit
6dc68950c0
7 files changed
+20
-68
No files matched your search
@@ -699,13 +699,10 @@ func (q *checker) bcheckVar(n *a.Var) error {
|
||||
|
||||
lhs := a.NewExpr(0, 0, 0, n.Name(), nil, nil, nil, nil)
|
||||
lhs.SetMType(n.XType())
|
||||
rhs := n.Value()
|
||||
if rhs == nil {
|
||||
// "var x T" has an implicit "= 0".
|
||||
//
|
||||
// TODO: check that T is an integer type.
|
||||
rhs = zeroExpr
|
||||
}
|
||||
// "var x T" has an implicit "= 0".
|
||||
//
|
||||
// TODO: check that T is an integer type.
|
||||
rhs := zeroExpr
|
||||
return q.bcheckAssignment(lhs, t.IDEq, rhs)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user