You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import std/[sequtils, macros]
typeFuture[T] =objectInternalRaisesFuture[T, E] =objectmacroRaising*[T](F: typedesc[Future[T]], E: varargs[typedesc]): untyped=## Given a Future type instance, return a type storing `{.raises.}`## information#### Note; this type may change in the future
E.expectKind(nnkBracket)
let raises = nnkTupleConstr.newTree(E.mapIt(it))
nnkBracketExpr.newTree(
ident"InternalRaisesFuture",
nnkDotExpr.newTree(F, ident"T"),
raises
)
type X[E] =Future[void].Raising(E)
procf(x: X) =discardvar v: Future[void].Raising([ValueError])
f(v)
Nim Version
works in 1.6, broken in 2.0, devel
Current Output
testit.nim(21, 25) Error: expected type, but got: Raising(Future[void], E)