mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-21 06:10:56 +00:00
fixes #25469; Conversion from distinct in for forces a copy of underlying instance
This commit is contained in:
@@ -702,6 +702,11 @@ proc putArgInto(arg: PNode, formal: PType): TPutArgInto =
|
||||
of nkAddr, nkHiddenAddr:
|
||||
result = putArgInto(arg[0], formal)
|
||||
if result == paViaIndirection: result = paFastAsgn
|
||||
of nkHiddenStdConv, nkHiddenSubConv, nkConv:
|
||||
if compareTypes(arg.typ, arg[1].typ, dcEqIgnoreDistinct, {IgnoreRangeShallow}):
|
||||
result = putArgInto(arg[1], formal)
|
||||
else:
|
||||
result = paFastAsgn
|
||||
of nkCurly, nkBracket:
|
||||
for i in 0..<arg.len:
|
||||
if putArgInto(arg[i], formal) != paDirectMapping:
|
||||
|
||||
Reference in New Issue
Block a user