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

@ -1405,9 +1405,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
"' is only valid for macros and templates")
# 'auto' as a return type does not imply a generic:
elif r.kind == tyAnything:
# 'p(): auto' and 'p(): untyped' are equivalent, but the rest of the
# compiler is hardly aware of 'auto':
r = newTypeS(tyUntyped, c)
discard
elif r.kind == tyStatic:
# type allowed should forbid this type
discard