mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Type and bounds check the "x" in "return x"
This commit is contained in:
1 parent
c84732f3d3
commit
24ace1c144
3 files changed
+32
-11
No files matched your search
@@ -433,6 +433,13 @@ func (c *Checker) checkFuncSignature(node *a.Node) error {
|
||||
}
|
||||
setPlaceholderMBoundsMType(n.In().AsNode())
|
||||
if out := n.Out(); out != nil {
|
||||
if n.Effect().Optional() && n.Receiver()[0] != t.IDBase {
|
||||
return &Error{
|
||||
Err: fmt.Errorf("func %s has ? effect but non-empty return type", n.QQID().Str(c.tm)),
|
||||
Filename: n.Filename(),
|
||||
Line: n.Line(),
|
||||
}
|
||||
}
|
||||
// TODO: does checking a TypeExpr need a q?
|
||||
q := &checker{
|
||||
c: c,
|
||||
|
||||
Reference in new issue
Block a user