compiler error with generic method
Posted: Mon Jun 01, 2009 4:38 pm
this doesn't compile:
compiled with
any idea what is wrong?
class Sample
shared
def main
print "hello"
def method<of T>(doStuff as Func<of T>) as Response<of T>
result = doStuff()
return Response<of T>(value=result)
class Response<of T>
pro value from var as T
compiled with
- Code: Select all
cobra -ref:"C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" test
c:\tmp\cobratickets\test.cobra(1): error: The type or namespace name "T" could not be found (are you missing a using directive or an assembly reference?)
Compilation failed - 1 error, 0 warnings
Not running due to errors above.
any idea what is wrong?