When using an iterator that uses a static parameter for the return type as following the DSL causes an error:
import owlkettle
type
Thing = enum
a, b, c
MyType[T: static Thing] = object
iterator doThing(val: static Thing): MyType[val] = yield MyType[val]()
viewable App:
a: int
method view(app: AppState): Widget =
result = gui:
Window:
title = "Counter"
defaultSize = (200, 60)
Box():
for val in doThing(a):
Label(text = "hello")
brew(gui(App()))
/home/jason/.nimble/pkgs/owlkettle-#head/owlkettle/guidsl.nim(189, 23) Error: A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature.
This might be resolved in closure generation by wrapping with when ident isnot static: var ident = ident. Or if the code is typed checking if the symKind is a var/let instead of just using all syms.
When using an iterator that uses a static parameter for the return type as following the DSL causes an error:
/home/jason/.nimble/pkgs/owlkettle-#head/owlkettle/guidsl.nim(189, 23) Error: A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature.
This might be resolved in closure generation by wrapping with
when ident isnot static: var ident = ident
. Or if the code is typed checking if thesymKind
is a var/let instead of just using all syms.