summary refs log tree commit diff stats
path: root/tests/overload/toverl3.nim
blob: 92cfc150d8730c255d02d37d129bbfba79fc63b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
discard """
  file: "toverl3.nim"
  output: '''m1
tup1'''
"""

# Tests more specific generic match:

proc m[T](x: T) = echo "m2"
proc m[T](x: var ref T) = echo "m1"

proc tup[S, T](x: tuple[a: S, b: ref T]) = echo "tup1"
proc tup[S, T](x: tuple[a: S, b: T]) = echo "tup2"

var
  obj: ref int
  tu: tuple[a: int, b: ref bool]

m(obj)
tup(tu)