* fixes `@[]` type inference in generics * add issue links * fixes macros and iterators * refactor * add one more test
This commit is contained in:
parent
2d9af2bd55
commit
64a0355f3f
4 changed files with 51 additions and 5 deletions
|
|
@ -526,7 +526,7 @@ proc checkDefault(c: PContext, n: PNode): PNode =
|
|||
message(c.config, n.info, warnUnsafeDefault, typeToString(constructed))
|
||||
|
||||
proc magicsAfterOverloadResolution(c: PContext, n: PNode,
|
||||
flags: TExprFlags): PNode =
|
||||
flags: TExprFlags; expectedType: PType = nil): PNode =
|
||||
## This is the preferred code point to implement magics.
|
||||
## ``c`` the current module, a symbol table to a very good approximation
|
||||
## ``n`` the ast like it would be passed to a real macro
|
||||
|
|
@ -635,5 +635,9 @@ proc magicsAfterOverloadResolution(c: PContext, n: PNode,
|
|||
result = n
|
||||
of mPrivateAccess:
|
||||
result = semPrivateAccess(c, n)
|
||||
of mArrToSeq:
|
||||
result = n
|
||||
if result.typ != nil and expectedType != nil and result.typ.kind == tySequence and expectedType.kind == tySequence and result.typ[0].kind == tyEmpty:
|
||||
result.typ = expectedType # type inference for empty sequence # bug #21377
|
||||
else:
|
||||
result = n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue