new inference: nothing should be cached during overload resolution (IDEA-136759)

This commit is contained in:
Anna Kozlova
2015-02-24 19:00:41 +01:00
parent 1de1e949f4
commit e63a2de86f
8 changed files with 111 additions and 49 deletions

View File

@@ -0,0 +1,19 @@
import java.util.function.Function;
import java.util.stream.Stream;
class Test {
public Long getKey() {
return 0L;
}
public static void main(Stream<Test> stream) {
stream.map(s -> Inner.of(Test::getKey, s));
}
public static final class Inner<K> {
public static <T> Inner<T> of(final Object key, final Test value) {return null;}
public static <T> Inner<T> of(final Function< T, Long> keyMapper, final Test value) {return null;}
}
}

View File

@@ -0,0 +1,19 @@
import java.util.function.Function;
import java.util.stream.Stream;
class Test {
public Long getKey() {
return 0L;
}
public static void main(Stream<Test> stream) {
stream.map(s -> Inner.of(Test::get<ref>Key, s));
}
public static final class Inner<K> {
public static <T> Inner<T> of(final Object key, final Test value) {return null;}
public static <T> Inner<T> of(final Function< T, Long> keyMapper, final Test value) {return null;}
}
}