toverl3.nim 341 B

123456789101112131415161718192021
  1. discard """
  2. file: "toverl3.nim"
  3. output: '''m1
  4. tup1'''
  5. """
  6. # Tests more specific generic match:
  7. proc m[T](x: T) = echo "m2"
  8. proc m[T](x: var ref T) = echo "m1"
  9. proc tup[S, T](x: tuple[a: S, b: ref T]) = echo "tup1"
  10. proc tup[S, T](x: tuple[a: S, b: T]) = echo "tup2"
  11. var
  12. obj: ref int
  13. tu: tuple[a: int, b: ref bool]
  14. m(obj)
  15. tup(tu)