generic mixin
Posted: Sun Nov 01, 2009 7:48 am
I don't know if this should be supported, but for completeness of weird syntax tests:
will get the following compile error
mixin IsOk<of T>
var isOk as bool is public
def getFoo(v as T) as T
return v
class Ok adds IsOk<of int>
pass
namespace MixinWithinNamespaces
class Program
shared
def main
ok = Ok()
print ok.isOk
#print ok.getFoo(1)
will get the following compile error
- Code: Select all
test.cobra(4): error: Cannot return T because "getFoo" is declared to return a int.