fix: check that a function returns the correct number of values

This commit is contained in:
Marc Vertes
2020-05-03 18:08:03 +02:00
committed by GitHub
parent e12c8b72c4
commit f6c8b8b14f
6 changed files with 66 additions and 0 deletions

View File

@@ -705,6 +705,13 @@ func (t *itype) referTo(name string, seen map[*itype]bool) bool {
return false
}
func (t *itype) numOut() int {
if t.cat == valueT {
return t.rtype.NumOut()
}
return len(t.ret)
}
func (t *itype) concrete() *itype {
if isInterface(t) && t.val != nil {
return t.val.concrete()