fix #15836 proc arg return type auto unexpectly match proc with concr… (#21044)

fix #15836 proc arg return type auto unexpectly match proc with concrete type
This commit is contained in:
Bung 2022-12-10 01:01:13 +08:00 • committed by GitHub
commit 0cd9bdcf9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 12 deletions

View file

@ -1913,8 +1913,8 @@ proc semProcBody(c: PContext, n: PNode; expectedType: PType = nil): PNode =
else:
localError(c.config, c.p.resultSym.info, errCannotInferReturnType %
c.p.owner.name.s)
if isInlineIterator(c.p.owner.typ) and c.p.owner.typ[0] != nil and
c.p.owner.typ[0].kind == tyUntyped:
if isIterator(c.p.owner.typ) and c.p.owner.typ[0] != nil and
c.p.owner.typ[0].kind == tyAnything:
localError(c.config, c.p.owner.info, errCannotInferReturnType %
c.p.owner.name.s)
closeScope(c)