tnestedissues.nim 715 B

12345678910111213141516171819202122232425
  1. block: # issue #23568
  2. type G[T] = object
  3. j: T
  4. proc s[T](u: int) = discard
  5. proc s[T]() = discard
  6. proc c(e: int | int): G[G[G[int]]] = s[G[G[int]]]()
  7. discard c(0)
  8. import std/options
  9. block: # issue #23310
  10. type
  11. BID = string or uint64
  12. Future[T] = ref object of RootObj
  13. internalValue: T
  14. InternalRaisesFuture[T] = ref object of Future[T]
  15. proc newInternalRaisesFutureImpl[T](): InternalRaisesFuture[T] =
  16. let fut = InternalRaisesFuture[T]()
  17. template newFuture[T](): auto =
  18. newInternalRaisesFutureImpl[T]()
  19. proc problematic(blockId: BID): Future[Option[seq[int]]] =
  20. let resultFuture = newFuture[Option[seq[int]]]()
  21. return resultFuture
  22. let x = problematic("latest")