Add via keyword and named args.

This commit is contained in:
Nigel Tao committed 2017-05-19 16:14:05 +10:00
1 parent 9719fab535
commit 06eaadb1d6
7 files changed
+86 -27

No files matched your search

+6 -1
View File
@@ -136,8 +136,13 @@ func (c *checker) tcheckAssert(n *a.Assert) error {
return fmt.Errorf("check: assert condition %q, of type %q, does not have a boolean type",
cond.String(c.idMap), cond.MType().String(c.idMap))
}
for _, a := range n.Args() {
if err := c.tcheckExpr(a.Arg().Value(), 0); err != nil {
return err
}
a.SetTypeChecked()
}
// TODO: check that there are no side effects.
// TODO: check the actual assertion.
return nil
}