summary refs log tree commit diff stats
path: root/tests/errmsgs/tnested_generic_instantiation.nim
blob: ab9ab54cdf1fc936e26fb878c3f06eb72f734373 (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
discard """
action: compile
"""

# 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)