tnested_generic_instantiation.nim 335 B

12345678910111213141516171819202122232425
  1. discard """
  2. action: compile
  3. """
  4. # bug #4766
  5. type
  6. Plain = ref object
  7. discard
  8. Wrapped[T] = object
  9. value: T
  10. converter toWrapped[T](value: T): Wrapped[T] =
  11. Wrapped[T](value: value)
  12. let result = Plain()
  13. discard $result
  14. proc foo[T2](a: Wrapped[T2]) =
  15. # Error: generic instantiation too nested
  16. discard $a
  17. foo(result)