diff --git a/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java b/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java index ab5d7736857..7f011f31166 100644 --- a/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java +++ b/compiler/frontend/src/org/jetbrains/jet/JetNodeTypes.java @@ -65,7 +65,7 @@ public interface JetNodeTypes { IElementType TYPE_REFERENCE = JetStubElementTypes.TYPE_REFERENCE; IElementType USER_TYPE = JetStubElementTypes.USER_TYPE; - JetNodeType FUNCTION_TYPE = new JetNodeType("FUNCTION_TYPE", JetFunctionType.class); + IElementType FUNCTION_TYPE = JetStubElementTypes.FUNCTION_TYPE; JetNodeType FUNCTION_TYPE_RECEIVER = new JetNodeType("FUNCTION_TYPE_RECEIVER", JetFunctionTypeReceiver.class); JetNodeType SELF_TYPE = new JetNodeType("SELF_TYPE", JetSelfType.class); IElementType NULLABLE_TYPE = JetStubElementTypes.NULLABLE_TYPE; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFunctionType.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFunctionType.java index 4f1a92948e7..d8c276ada0c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFunctionType.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetFunctionType.java @@ -21,6 +21,8 @@ import com.intellij.lang.ASTNode; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.JetNodeTypes; +import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub; +import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes; import org.jetbrains.jet.lexer.JetToken; import org.jetbrains.jet.lexer.JetTokens; @@ -28,7 +30,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class JetFunctionType extends JetElementImpl implements JetTypeElement { +public class JetFunctionType extends JetElementImplStub> implements JetTypeElement { public static final JetToken RETURN_TYPE_SEPARATOR = JetTokens.ARROW; @@ -36,6 +38,10 @@ public class JetFunctionType extends JetElementImpl implements JetTypeElement { super(node); } + public JetFunctionType(@NotNull PsiJetPlaceHolderStub stub) { + super(stub, JetStubElementTypes.FUNCTION_TYPE); + } + @NotNull @Override public List getTypeArgumentsAsTypes() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTypeReference.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTypeReference.java index 38e9528c63e..f68f8452977 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTypeReference.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetTypeReference.java @@ -36,7 +36,8 @@ import static org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes.ANNO */ public class JetTypeReference extends JetElementImplStub> { - public static final TokenSet TYPE_ELEMENTS = TokenSet.create(JetStubElementTypes.USER_TYPE, JetStubElementTypes.NULLABLE_TYPE); + public static final TokenSet TYPE_ELEMENTS + = TokenSet.create(JetStubElementTypes.USER_TYPE, JetStubElementTypes.NULLABLE_TYPE, JetStubElementTypes.FUNCTION_TYPE); public JetTypeReference(@NotNull ASTNode node) { super(node); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.java index caa79126ec9..7ef3a14ee4b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.java @@ -62,6 +62,9 @@ public interface JetStubElementTypes { new JetPlaceHolderStubElementType("TYPE_REFERENCE", JetTypeReference.class);; JetUserTypeElementType USER_TYPE = new JetUserTypeElementType("USER_TYPE"); + + JetPlaceHolderStubElementType FUNCTION_TYPE = + new JetPlaceHolderStubElementType("FUNCTION_TYPE", JetFunctionType.class); JetNameReferenceExpressionElementType REFERENCE_EXPRESSION = new JetNameReferenceExpressionElementType("REFERENCE_EXPRESSION"); JetDotQualifiedExpressionElementType DOT_QUALIFIED_EXPRESSION = new JetDotQualifiedExpressionElementType("DOT_QUALIFIED_EXPRESSION");