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.