fixes #21377; fixes @[] and {} type inference as returns in generics (#21475)

* fixes `@[]` type inference in generics

* add issue links

* fixes macros and iterators

* refactor

* add one more test
This commit is contained in:
ringabout 2023-03-06 22:30:22 +08:00 • committed by GitHub
commit 64a0355f3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 5 deletions

View file

@ -998,7 +998,7 @@ proc afterCallActions(c: PContext; n, orig: PNode, flags: TExprFlags; expectedTy
fixAbstractType(c, result)
analyseIfAddressTakenInCall(c, result)
if callee.magic != mNone:
result = magicsAfterOverloadResolution(c, result, flags)
result = magicsAfterOverloadResolution(c, result, flags, expectedType)
when false:
if result.typ != nil and
not (result.typ.kind == tySequence and result.typ[0].kind == tyEmpty):