summary refs log tree commit diff stats
path: root/tests/errmsgs/tnested_generic_instantiation.nim
blob: 77353605c6c4d0434f14de1a9336462f5502485f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
discard """
errormsg: "generic instantiation too nested"
file: "system.nim"
"""

# bug #4766

type
  Plain = ref object
    discard

  Wrapped[T] = object
    value: T

converter toWrapped[T](value: T): Wrapped[T] =
  Wrapped[T](value: value)

let result = Plain()
discard $result

proc foo[T2](a: Wrapped[T2]) =
  # Error: generic instantiation too nested
  discard $a

foo(result)