mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
testResolveDiamondBeforeOuterCall (fails if new expression type is requested before highlighting)
GitOrigin-RevId: b01abb3fbbebe28e3115aa109005851b62a02e7b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6153642c31
commit
85f72bfc0f
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
class Test {
|
||||
Test(final Set<? super String> set) {
|
||||
System.out.println(join(new TreeSet<>(set), ""));
|
||||
}
|
||||
|
||||
public static String join(Iterable<?> items, String separator) {return items+separator;}
|
||||
public static String join(Collection<String> strings, String separator) {return strings + separator;}
|
||||
}
|
||||
+10
@@ -23,6 +23,7 @@ import com.intellij.psi.impl.source.resolve.DefaultParameterTypeInferencePolicy;
|
||||
import com.intellij.psi.infos.CandidateInfo;
|
||||
import com.intellij.psi.infos.MethodCandidateInfo;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -298,6 +299,15 @@ public class Java8ExpressionsCheckTest extends LightDaemonAnalyzerTestCase {
|
||||
doTestAllMethodCallExpressions();
|
||||
}
|
||||
|
||||
public void testResolveDiamondBeforeOuterCall() {
|
||||
configure();
|
||||
doHighlighting(); // remove this call, and test will fail
|
||||
PsiNewExpression newExpression = ContainerUtil.getOnlyItem(PsiTreeUtil.findChildrenOfType(getFile(), PsiNewExpression.class));
|
||||
assertNotNull(newExpression);
|
||||
PsiType type = newExpression.getType();
|
||||
assertEquals("java.util.TreeSet<? super java.lang.String>", type.getCanonicalText());
|
||||
}
|
||||
|
||||
private void doTestAllMethodCallExpressions() {
|
||||
configure();
|
||||
final Collection<PsiCallExpression> methodCallExpressions = PsiTreeUtil.findChildrenOfType(getFile(), PsiCallExpression.class);
|
||||
|
||||
Reference in New Issue
Block a user