Files
kotlin/compiler/testData/codegen/boxWithJava/builtinStubMethods/extendJavaCollections/Test.java
Alexander Udalov 35e956609a Rewrite mutable collection stub method generation
The main problem of the previous approach was that we were only generating
erased method signatures, which was incorrect in case a class also had a member
from another supertype with the same signature as the substituted one from the
collection. Javac issues compilation errors when compiling Java code against
such classes.

Also all the needed method stub signatures were hardcoded in
generateBuiltInMethodStubs() and the case of MutableListIterator was missing
2014-10-27 17:17:31 +03:00

21 lines
653 B
Java

import java.lang.*;
import java.util.*;
public class Test {
public static class IterableImpl implements Iterable<String> {
public Iterator<String> iterator() { return new IteratorImpl(); }
}
public static class IteratorImpl implements Iterator<String> {
public boolean hasNext() { return false; }
public String next() { return null; }
public void remove() { }
}
public static class MapEntryImpl implements Map.Entry<String, String> {
public String getKey() { return null; }
public String getValue() { return null; }
public String setValue(String s) { return null; }
}
}