From a149d38c98f2ca17af22784a7350986eba45dc7e Mon Sep 17 00:00:00 2001 From: Vladimir Dolzhenko Date: Mon, 28 Sep 2020 11:12:32 +0200 Subject: [PATCH] Register TYPE_CODE_FRAGMENT in KtStubElementTypes Stubbed type has to be register earlier (see IStubFileElementType#checkNotInstantiatedTooLate) ^KT-28732 Fixed --- compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java | 2 +- .../jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java b/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java index 3696e7dc73b..47e5e470581 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java +++ b/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java @@ -160,7 +160,7 @@ public interface KtNodeTypes { IElementType SCRIPT = KtStubElementTypes.SCRIPT; - IFileElementType TYPE_CODE_FRAGMENT = new KtTypeCodeFragmentType(); + IFileElementType TYPE_CODE_FRAGMENT = KtStubElementTypes.TYPE_CODE_FRAGMENT; IFileElementType EXPRESSION_CODE_FRAGMENT = new KtExpressionCodeFragmentType(); IFileElementType BLOCK_CODE_FRAGMENT = new KtBlockCodeFragmentType(); } diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java index e16e20644d2..0bd3db12f51 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java @@ -89,6 +89,8 @@ public interface KtStubElementTypes { KtPlaceHolderStubElementType FUNCTION_TYPE = new KtPlaceHolderStubElementType<>("FUNCTION_TYPE", KtFunctionType.class); + KtTypeCodeFragmentType TYPE_CODE_FRAGMENT = new KtTypeCodeFragmentType(); + KtTypeProjectionElementType TYPE_PROJECTION = new KtTypeProjectionElementType("TYPE_PROJECTION"); KtPlaceHolderStubElementType FUNCTION_TYPE_RECEIVER =