@@ -0,0 +1,2312 @@
+/*%0A * Copyright 2000-2014 JetBrains s.r.o.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.intellij.codeInsight.daemon.lambda;%0A%0Aimport com.intellij.psi.PsiElement;%0Aimport com.intellij.psi.PsiExpression;%0Aimport com.intellij.psi.PsiIdentifier;%0Aimport com.intellij.psi.PsiType;%0Aimport com.intellij.testFramework.LightProjectDescriptor;%0Aimport com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.junit.Assert;%0A%0Apublic class InferredTypeTest extends LightCodeInsightFixtureTestCase %7B%0A  public void testNestedCallReturnType() throws Exception %7B%0A    myFixture.configureByText(%22a.java%22, %22import java.util.List;%5Cn%22 +%0A                                        %22abstract class Test %7B%5Cn%22 +%0A                                        %22    abstract %3CR, K%3E R foo(K k1, K k2);%5Cn%22 +%0A                                        %22    %7B%5Cn%22 +%0A                                        %22        String str = %5C%22%5C%22;%5Cn%22 +%0A                                        %22        List%3CString%3E l = f%3Ccaret%3Eoo(foo(str, str), str);%5Cn%22 +%0A                                        %22    %7D%5Cn%22 +%0A                                        %22%7D%5Cn%22);%0A    final PsiElement elementAtCaret = myFixture.getFile().findElementAt(myFixture.getCaretOffset());%0A    Assert.assertTrue(elementAtCaret instanceof PsiIdentifier);%0A%0A    final PsiElement refExpr = elementAtCaret.getParent();%0A    Assert.assertTrue(refExpr.toString(), refExpr instanceof PsiExpression);%0A    final PsiType type = ((PsiExpression)refExpr).getType();%0A    Assert.assertNotNull(refExpr.toString(), type);%0A    Assert.assertTrue(type.getCanonicalText(), type.equalsToText(%22java.util.List%3Cjava.lang.String%3E%22));%0A  %7D%0A%0A  @NotNull%0A  @Override%0A  protected LightProjectDescriptor getProjectDescriptor() %7B%0A    return JAVA_8;%0A  %7D%0A%7D%0A

check inferred type test