tisolate2.nim 290 B

1234567891011121314151617181920212223
  1. discard """
  2. errormsg: "expression cannot be isolated: a_to_b(a)"
  3. line: 22
  4. """
  5. # bug #19013
  6. import std/isolation
  7. type Z = ref object
  8. i: int
  9. type A = object
  10. z: Z
  11. type B = object
  12. z: Z
  13. func a_to_b(a: A): B =
  14. result = B(z: a.z)
  15. let a = A(z: Z(i: 3))
  16. let b = isolate(a_to_b(a))