""" http://cobra-language.com/forums/viewtopic.php?f=4&t=389 """ class Sample def main foo = .method(5) assert foo.value == 5 def method(item as T) as Foo # using extended initialization generates a helper method which requires # the same generic params as the enclosing method return Foo(value=item) class Foo pro value from var as T