Details
-
Bug
-
Resolution: Fixed
-
P2
-
8
-
b82
-
Verified
Description
This program fails to compile:
import java.util.*;
import java.util.stream.*;
class MostSpecific08 {
static class C {
int getInt() { return -1; }
Integer getInteger() { return -1; }
}
void testMref(Stream<C> sp) {
IntStream si_p = sp.map(C::getInt);
Stream<Integer> si_r = sp.map(C::getInteger);
}
void testLambda(Stream<C> sp) {
IntStream si_p = sp.map(c->c.getInt());
Stream<Integer> si_r = sp.map(c->c.getInteger());
}
}
class Test {
void g(IntFunc i) { }
void g(RefFunc i) { }
void test() {
g(Person::getAge);
}
}
import java.util.*;
import java.util.stream.*;
class MostSpecific08 {
static class C {
int getInt() { return -1; }
Integer getInteger() { return -1; }
}
void testMref(Stream<C> sp) {
IntStream si_p = sp.map(C::getInt);
Stream<Integer> si_r = sp.map(C::getInteger);
}
void testLambda(Stream<C> sp) {
IntStream si_p = sp.map(c->c.getInt());
Stream<Integer> si_r = sp.map(c->c.getInteger());
}
}
class Test {
void g(IntFunc i) { }
void g(RefFunc i) { }
void test() {
g(Person::getAge);
}
}