| 567 | } |
| 568 | |
| 569 | auto copy() const -> Val { |
| 570 | if (is_ref() && impl_.ref != nullptr) { |
| 571 | // TODO(mvsc): MVSC cannot handle this: |
| 572 | // impl impl = {.ref = impl_.ref->copy().release()}; |
| 573 | impl impl; |
| 574 | impl.ref = impl_.ref->copy().release(); |
| 575 | return Val(kind_, impl); |
| 576 | } else { |
| 577 | return Val(kind_, impl_); |
| 578 | } |
| 579 | } |
| 580 | }; |
| 581 | |
| 582 |