Forums

strange error with generic constraints

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

strange error with generic constraints

Postby gauthier » Sat Jan 09, 2010 5:49 am

class B<of TFoo>
where TFoo must be Program, callable
def foo as int
f = TFoo(bar=10)
return f.bar


class Program
pro bar from var as int?
def main is shared
b = B<of Program>()
b.foo


fail to compile with:

Code: Select all
error: COBRA INTERNAL ERROR / InvalidCastException / Unable to cast object of type 'GenericParam' to type 'ClassOrStruct'.
Compilation failed - 1 error, 0 warnings
Not running due to errors above.


note: just in case, no worry: using constructor and property assignation works ok
gauthier
 
Posts: 116

Re: strange error with generic constraints

Postby Charles » Sun Jan 10, 2010 1:02 am

Fixed. Thanks for the report.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 80 guests

cron