mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 22:35:24 +00:00
fixes implicitConv discarding flags (#24817)
follow up https://github.com/nim-lang/Nim/pull/24809
ref https://github.com/nim-lang/Nim/pull/24815
(cherry picked from commit 58b1f28177)
This commit is contained in:
@@ -2185,6 +2185,8 @@ proc implicitConv(kind: TNodeKind, f: PType, arg: PNode, m: TCandidate,
|
||||
# keep varness
|
||||
if arg.typ != nil and arg.typ.kind == tyVar:
|
||||
result.typ() = toVar(result.typ, tyVar, c.idgen)
|
||||
# copy the tfVarIsPtr flag
|
||||
result.typ.flags = arg.typ.flags
|
||||
else:
|
||||
result.typ() = result.typ.skipTypes({tyVar})
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
discard """
|
||||
targets: "c cpp"
|
||||
matrix: "--mm:refc; --mm:arc"
|
||||
output: '''
|
||||
it's nil
|
||||
@[1, 2, 3]
|
||||
|
||||
Reference in New Issue
Block a user