mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
new inference: String::length should be exact (IDEA-122191)
This commit is contained in:
@@ -163,7 +163,7 @@ public class PsiMethodReferenceExpressionImpl extends PsiReferenceExpressionBase
|
||||
if (containingClass != null) {
|
||||
PsiMethod[] methods = null;
|
||||
if (element instanceof PsiIdentifier) {
|
||||
methods = containingClass.findMethodsByName(element.getText(), true);
|
||||
methods = containingClass.findMethodsByName(element.getText(), !qualifierResolveResult.isReferenceTypeQualified());
|
||||
}
|
||||
else if (isConstructor()) {
|
||||
final PsiElementFactory factory = JavaPsiFacade.getElementFactory(getProject());
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import java.util.function.ToIntFunction;
|
||||
class Test {
|
||||
{
|
||||
fooBar(String::length);
|
||||
}
|
||||
|
||||
class Foo<K> {
|
||||
Foo<K> then() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
static <T> Foo<T> fooBar(ToIntFunction<? super T> keyExtractor) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -209,6 +209,10 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA112191() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user