Interface that extends Iterable<T>

58 views
Skip to first unread message

Matthew Molloy

unread,
Jun 14, 2015, 11:51:16 AM6/14/15
to haxe...@googlegroups.com
I am creating an interface that extends Iterable<T> (as well as other interfaces), however the following will not compile.

interface MyInterface extends Iterable {
  public function iterator ():Iterator<Dynamic>;
}

the error message is 

MyInterface.hx:1: lines 1-3 : Invalid number of type parameters for Iterable.


What is the correct way to proceed?


michael solomon

unread,
Jun 14, 2015, 12:20:35 PM6/14/15
to haxe...@googlegroups.com
Plz, if you open Question in stackoverflow too, give us a link that we can close the question their. http://stackoverflow.com/questions/30831375/haxe-interface-that-extends-iterable

Matthew Molloy

unread,
Jun 14, 2015, 6:35:19 PM6/14/15
to haxe...@googlegroups.com
Thanks, will do in future.

Alexander Kuzmenko

unread,
Jun 15, 2015, 2:59:25 AM6/15/15
to haxe...@googlegroups.com
Though Iterable<T> is not an interface, but if we pretend it is, you can extend it like this:
interface MyInterface<T> extends Iterable<T> {...}



воскресенье, 14 июня 2015 г., 18:51:16 UTC+3 пользователь Matthew Molloy написал:
Reply all
Reply to author
Forward
0 new messages