I'm trying to implement skip lists in Cobra as a means of exploring/learning the language. I started by implementing the basic interface I wanted wrapped around a regular list and now I am slowing converting it over to actually be a skip list... unfortunately I ran into some errors that I don't understand pretty quickly:
$ cobra skiplist.cobra
skiplist.cobra(113): error: Cannot return IComparable because "itemAt" is declared to return a IComparable.
skiplist.cobra(176): error: Argument 1 of method "indexOf" expects type IComparable, but the call is supplying type IComparable.
skiplist.cobra(179): error: Argument 1 of method "find" expects type IComparable, but the call is supplying type IComparable.
skiplist.cobra(182): error: Cannot return List<of IComparable> because "toList" is declared to return a List<of IComparable>.
Compilation failed - 4 errors, 0 warnings
Not running due to errors above.
The source code is here: https://github.com/lgastako/CobraSkipLi ... list.cobra
I don't expect the code to work yet but I don't understand why it would fail in this particular way -- in fact the error messages are confusing for obvious reasons -- in each case it seems to be saying "I wanted an X but you gave me an X" where X = X.
What am I missing?
Thanks.
P.S. Cobra is awesome.