tnested_generic_instantiation.nim 281 B

1234567891011121314151617181920
  1. discard """
  2. errormsg: "generic instantiation too nested"
  3. file: "system.nim"
  4. """
  5. # bug #4766
  6. type
  7. Plain = ref object
  8. discard
  9. Wrapped[T] = object
  10. value: T
  11. converter toWrapped[T](value: T): Wrapped[T] =
  12. Wrapped[T](value: value)
  13. let result = Plain()
  14. discard $result