EA-39113 Fail for "object { fun testing() = 12 }"
This commit is contained in:
+2
-2
@@ -25,8 +25,8 @@ import com.intellij.psi.stubs.StubOutputStream;
|
|||||||
import com.intellij.util.io.StringRef;
|
import com.intellij.util.io.StringRef;
|
||||||
import org.jetbrains.annotations.NonNls;
|
import org.jetbrains.annotations.NonNls;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
import org.jetbrains.jet.lang.psi.JetNamedFunction;
|
import org.jetbrains.jet.lang.psi.JetNamedFunction;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetFileStub;
|
|
||||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub;
|
import org.jetbrains.jet.lang.psi.stubs.PsiJetFunctionStub;
|
||||||
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetFunctionStubImpl;
|
import org.jetbrains.jet.lang.psi.stubs.impl.PsiJetFunctionStubImpl;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
@@ -67,7 +67,7 @@ public class JetFunctionElementType extends JetStubElementType<PsiJetFunctionStu
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PsiJetFunctionStub createStub(@NotNull JetNamedFunction psi, @NotNull StubElement parentStub) {
|
public PsiJetFunctionStub createStub(@NotNull JetNamedFunction psi, @NotNull StubElement parentStub) {
|
||||||
final boolean isTopLevel = parentStub instanceof PsiJetFileStub;
|
final boolean isTopLevel = psi.getParent() instanceof JetFile;
|
||||||
final boolean isExtension = psi.getReceiverTypeRef() != null;
|
final boolean isExtension = psi.getReceiverTypeRef() != null;
|
||||||
|
|
||||||
FqName qualifiedName = psi.getQualifiedName();
|
FqName qualifiedName = psi.getQualifiedName();
|
||||||
|
|||||||
@@ -75,6 +75,13 @@ public class JetStubsTest extends LightCodeInsightFixtureTestCase {
|
|||||||
" TYPE_PARAMETER:PsiJetTypeParameterStubImpl[name=T extendText=null]\n");
|
" TYPE_PARAMETER:PsiJetTypeParameterStubImpl[name=T extendText=null]\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testFunctionInNotNamedObject() {
|
||||||
|
doBuildTest("object { fun testing() = 12 }",
|
||||||
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
|
" FUN:PsiJetFunctionStubImpl[name=testing]\n" +
|
||||||
|
" VALUE_PARAMETER_LIST:PsiJetParameterListStubImpl\n");
|
||||||
|
}
|
||||||
|
|
||||||
public void testFunctionParameters() {
|
public void testFunctionParameters() {
|
||||||
doBuildTest("fun some(t: Int, other: String = \"hello\") { }",
|
doBuildTest("fun some(t: Int, other: String = \"hello\") { }",
|
||||||
"PsiJetFileStubImpl[package=]\n" +
|
"PsiJetFileStubImpl[package=]\n" +
|
||||||
|
|||||||
Reference in New Issue
Block a user