> Doesn't stevos code try to store just addresses of procs which return a
> Concept? Why shouldn't that be possible? The size of Damage doesn't have to
> be known for that, so it should be ok that it's not a concrete type.
I thought this too, and sure enough you can define procs that return concepts:
type
Conc = concept c
c.v is int
MyObj = object
v: int
proc test: Conc =
result = MyObj(v: 1)
echo test().repr
This outputs [v = 1].
However adding this line:
var x = [test]
Crashes the compiler with:
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
In fact, looks like declaring a seq of concept crashes:
var x: seq[Conc] # crash
So looks like this is a bug.