mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
21 lines
341 B
Nim
21 lines
341 B
Nim
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)
|