Skip to content

Commit 58b1f28

Browse files
authored
fixes implicitConv discarding flags (#24817)
follow up #24809 ref #24815
1 parent 73112d6 commit 58b1f28

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler/sigmatch.nim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,6 +2185,8 @@ proc implicitConv(kind: TNodeKind, f: PType, arg: PNode, m: TCandidate,
21852185
# keep varness
21862186
if arg.typ != nil and arg.typ.kind == tyVar:
21872187
result.typ() = toVar(result.typ, tyVar, c.idgen)
2188+
# copy the tfVarIsPtr flag
2189+
result.typ.flags = arg.typ.flags
21882190
else:
21892191
result.typ() = result.typ.skipTypes({tyVar})
21902192

tests/tuples/ttuples_various.nim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
discard """
2+
targets: "c cpp"
23
matrix: "--mm:refc; --mm:arc"
34
output: '''
45
it's nil

0 commit comments

Comments
 (0)