4 Commits

Author SHA1 Message Date
Ryan McConnell
184d423779 fixes 25713; Allow addr of object variant's discriminant under uncheckedAssign (#25714)
#25713

```nim
type
  K = enum
    k1,k2
  Variant = object
    case kind: K
    of k1:
      discard
    of k2:
      discard

proc a(x: var K) = discard
proc b(x: ptr K) = discard

var x = Variant(kind: k1)
{.cast(uncheckedAssign).}:
  # must be within uncheckedAssign to work
  a(x.kind)
# doesn't work out of or under uncheckedAssign
b(addr x.kind)
```
2026-04-07 06:59:24 +02:00
flywind
9c17a32e0e fix #19266; allow reassign discriminant field (#19567)
* add inUncheckedAssignSection

* add one more test
2022-02-25 20:33:28 +01:00
Andreas Rumpf
cddf8ec6f6 implements https://github.com/nim-lang/RFCs/issues/407 (#18793) 2021-09-03 21:52:24 +02:00
Araq
c2da0e9b3d cleanup index generation 2015-02-10 20:19:48 +01:00