Forums

generic method in mixin

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

generic method in mixin

Postby gauthier » Sun Nov 01, 2009 7:45 am

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
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
gauthier
 
Posts: 116

Return to Discussion

Who is online

Users browsing this forum: No registered users and 47 guests