| 573 | } |
| 574 | |
| 575 | auto copy() const -> Val { |
| 576 | if (is_ref() && impl_.ref != nullptr) { |
| 577 | // TODO(mvsc): MVSC cannot handle this: |
| 578 | // impl impl = {.ref = impl_.ref->copy().release()}; |
| 579 | impl impl; |
| 580 | impl.ref = impl_.ref->copy().release(); |
| 581 | return Val(kind_, impl); |
| 582 | } else { |
| 583 | return Val(kind_, impl_); |
| 584 | } |
| 585 | } |
| 586 | }; |
| 587 | |
| 588 |