Generics

Monkey Forums/Monkey Programming/Generics

Samah(Posted 2011) [#1]
Edit: This is actually a problem with abstract classes, and I've posted a bug report.

-------------------------------------------------

Monkey's current implementation of generics is somewhat broken. Here's some sample code that doesn't compile:
*snip*


And the equivalent in Java, that does:
*snip*


We get an "Error : Missing return expression." compile error on the line "Method TestMethod:T() Abstract".
I think the problem here is that in Monkey, TestMethod() is not compiled until it is used. Referencing the TestMethod() in TestClass appears to not generate the associated TestMethod() in TestClassTwo and TestClassThree.

Can you confirm this, Mark?