Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Incorrect mapping of Iterator.next() #44

Open
ainslec opened this issue Mar 29, 2014 · 1 comment
Open

Incorrect mapping of Iterator.next() #44

ainslec opened this issue Mar 29, 2014 · 1 comment

Comments

@ainslec
Copy link

ainslec commented Mar 29, 2014

The following code is mapped incorrectly :

Source Java

Collection<SomeClass> myCollection = getCollection();
SomeClass firstItem = myCollection.iterator().next(); // Assuming we know there is at least one item
doSomething(firstItem);

Generated C#

Collection<SomeClass> myCollection = getCollection();
SomeClass firstItem = myCollection .GetEnumerator().Next(); // ERROR Because there is no Next() method on the enumerator.
doSomething(firstItem);
@ainslec ainslec changed the title Incorrect mapping of Incorrect mapping of Iterator.next() Mar 29, 2014
@hazzik
Copy link
Contributor

hazzik commented Mar 29, 2014

Probably you should disable mapping of Iterators to IEnumerable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants