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
The following doesn't compile and gives invalid type in this context for var
Error: invalid type: 'Queue[module_name.FooWrapper]' in this context: 'FooWrapper' for var
typeFoo=ptrobject
next: FooEnqueueable=concept x, type T
x isptr
x.next is T
FooWrapper=ptrobject
next: FooWrapper
foo: Foo
queue: Queue[FooWrapper]
Queue[T: Enqueueable] =object
count: int
back: T
# Ok so farvar q: Queue[Foo]
# ------------------------------static: echoFooWrapperisEnqueueablevar fw: FooWrapper
The text was updated successfully, but these errors were encountered:
"All problems in computer science can be solved by another level of indirection" - David Wheeler
The following compiles (declaration order may have a play there, I didn't fully figure out the differences).
typeEnqueueable* {.explain.} =concept x, type T
x isptr
x.next is T
Queue*[T: Enqueueable] =object
count: int
back: T
Foo=ptrobject
next: FooFooWrapper=ptrobject
next: FooWrapper
foo: Foo
bar: BarBar=object
queue: Queue[FooWrapper]
# Ok so farvar q: Queue[Foo]
# ------------------------------static: echoFooWrapperisEnqueueablevar fw: FooWrapper
The following doesn't compile and gives invalid type in this context for var
The text was updated successfully, but these errors were encountered: