generic method in mixin
Posted: Sun Nov 01, 2009 7:45 am
I got internal error when compiling this:
the compiler doesn't seem to understand the generic method signature
mixin IsOk
var isOk as bool is public
def getFoo<T>(v as T) as T
return v
class Ok adds IsOk
pass
namespace MixinWithinNamespaces
class Program
shared
def main
ok = Ok()
print ok.isOk
print ok.getFoo<of int>(1)
- Code: Select all
error: COBRA INTERNAL ERROR / AssertException / ; sourceSite = C:\home\dev\src\projects\cobra\Source\CobraParser.cobra:1410 in CobraParser.declareMethod for object CobraParser; info = nil; this = CobraParser; .last.which.isOneOf('EOL.INDENT.') = false; .last.which = 'ID'; .last = Token(ID, 'getFoo', 'getFoo', ln 3, col 6, test.cobra);
the compiler doesn't seem to understand the generic method signature