Page 1 of 1

generic method in mixin

PostPosted: Sun Nov 01, 2009 7:45 am
by gauthier
I got internal error when compiling this:
mixin IsOk
var isOk as bool is public
def getFoo<T>(v as T) as T
return v
class Ok adds IsOk

namespace MixinWithinNamespaces
class Program
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