mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
fixes #24492 Kind of a goofy way of doing this, but we count how many derefs were used for the first parameter before calling `builtinFieldAccess`, then count after, and if there are more now than before, we remove the added derefs. I thought maybe getting rid of #18298 would simplify it but maybe this would still be the best way. For better encapsulation we could make `dotTransformation` take an `nOrig` param instead but this would be less efficient since it would need a copy, though `semAsgn` already makes one.
7 lines
119 B
Nim
7 lines
119 B
Nim
block: # issue #24492
|
|
type MyType = ref object
|
|
a: int
|
|
|
|
proc a(val: MyType, i: int) = discard
|
|
MyType().a(100)
|