method refs IDEA-112323

This commit is contained in:
Anna Kozlova
2013-08-20 13:14:33 +04:00
parent fe38c54738
commit 6e9b26f3b1
3 changed files with 30 additions and 1 deletions

View File

@@ -393,7 +393,7 @@ public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
}
private PsiSubstitutor getSubstitutor(PsiType type) {
final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(type);
final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(GenericsUtil.eliminateWildcards(type));
PsiSubstitutor psiSubstitutor = resolveResult.getSubstitutor();
if (type instanceof PsiClassType) {
final PsiClass psiClass = resolveResult.getElement();

View File

@@ -0,0 +1,25 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
class Test1
{
public static void main(Stream<Map.Entry<String, Long>> stream)
{
Stream<String> map = stream.map(Map.Entry::getKey);
}
public static void main(String[] args)
{
Map<String, Long> storage = new HashMap<>();
storage.put("One", 1l);
List<String> keys = storage
.entrySet()
.stream()
.map(Map.Entry::getKey)
.collect(Collectors.toList());
keys.stream().forEach(System.out::println);
}
}

View File

@@ -83,6 +83,10 @@ public class MethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
doTest();
}
public void testIDEA112323() throws Exception {
doTest();
}
private void doTest() {
doTest(false);
}