Drop support for T!! syntactic structure

^KT-26245 In Progress
This commit is contained in:
Denis.Zharkov
2021-08-09 13:10:42 +03:00
committed by teamcityserver
parent 302eacbf59
commit c1b5d5551f
43 changed files with 2 additions and 902 deletions
@@ -75,7 +75,6 @@ public interface KtNodeTypes {
IElementType FUNCTION_TYPE = KtStubElementTypes.FUNCTION_TYPE;
IElementType FUNCTION_TYPE_RECEIVER = KtStubElementTypes.FUNCTION_TYPE_RECEIVER;
IElementType NULLABLE_TYPE = KtStubElementTypes.NULLABLE_TYPE;
IElementType DEFINITELY_NOT_NULL_TYPE = KtStubElementTypes.DEFINITELY_NOT_NULL_TYPE;
IElementType INTERSECTION_TYPE = KtStubElementTypes.INTERSECTION_TYPE;
IElementType TYPE_PROJECTION = KtStubElementTypes.TYPE_PROJECTION;
@@ -1,35 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.psi
import com.intellij.lang.ASTNode
import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
class KtDefinitelyNotNullType : KtElementImplStub<KotlinPlaceHolderStub<KtDefinitelyNotNullType>>, KtTypeElement {
constructor(node: ASTNode) : super(node)
constructor(stub: KotlinPlaceHolderStub<KtDefinitelyNotNullType>) : super(stub, KtStubElementTypes.DEFINITELY_NOT_NULL_TYPE)
override fun getTypeArgumentsAsTypes(): List<KtTypeReference> {
return this.innerType?.typeArgumentsAsTypes ?: emptyList()
}
override fun <R, D> accept(visitor: KtVisitor<R, D>, data: D): R {
return visitor.visitDefinitelyNotNullType(this, data)
}
@get:IfNotParsed
val innerType: KtTypeElement?
get() = KtStubbedPsiUtil.getStubOrPsiChild(this, KtStubElementTypes.TYPE_ELEMENT_TYPES, KtTypeElement.ARRAY_FACTORY)
val modifierList: KtModifierList?
get() = getStubOrPsiChild(KtStubElementTypes.MODIFIER_LIST)
val annotationEntries: List<KtAnnotationEntry>
get() {
return modifierList?.annotationEntries ?: emptyList()
}
}
@@ -402,10 +402,6 @@ public class KtVisitor<R, D> extends PsiElementVisitor {
return visitTypeElement(nullableType, data);
}
public R visitDefinitelyNotNullType(@NotNull KtDefinitelyNotNullType definitelyNotNullType, D data) {
return visitTypeElement(definitelyNotNullType, data);
}
public R visitIntersectionType(@NotNull KtIntersectionType definitelyNotNullType, D data) {
return visitTypeElement(definitelyNotNullType, data);
}
@@ -385,10 +385,6 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
super.visitNullableType(nullableType, null);
}
public void visitDefinitelyNotNullType(@NotNull KtDefinitelyNotNullType definitelyNotNullType) {
super.visitDefinitelyNotNullType(definitelyNotNullType, null);
}
public void visitIntersectionType(@NotNull KtIntersectionType intersectionType) {
super.visitIntersectionType(intersectionType, null);
}
@@ -980,12 +976,6 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
return null;
}
@Override
public Void visitDefinitelyNotNullType(@NotNull KtDefinitelyNotNullType definitelyNotNullType, Void data) {
visitDefinitelyNotNullType(definitelyNotNullType);
return null;
}
@Override
public Void visitIntersectionType(@NotNull KtIntersectionType intersectionType, Void data) {
visitIntersectionType(intersectionType);
@@ -708,7 +708,6 @@ val KtNameReferenceExpression.isUnderscoreInBackticks
tailrec fun KtTypeElement.unwrapNullability(): KtTypeElement? {
return when (this) {
is KtNullableType -> this.innerType?.unwrapNullability()
is KtDefinitelyNotNullType -> this.innerType?.unwrapNullability()
else -> this
}
}
@@ -79,9 +79,6 @@ public interface KtStubElementTypes {
KtPlaceHolderStubElementType<KtNullableType> NULLABLE_TYPE =
new KtPlaceHolderStubElementType<>("NULLABLE_TYPE", KtNullableType.class);
KtPlaceHolderStubElementType<KtDefinitelyNotNullType> DEFINITELY_NOT_NULL_TYPE =
new KtPlaceHolderStubElementType<>("DEFINITELY_NOT_NULL_TYPE", KtDefinitelyNotNullType.class);
KtPlaceHolderStubElementType<KtIntersectionType> INTERSECTION_TYPE =
new KtPlaceHolderStubElementType<>("INTERSECTION_TYPE", KtIntersectionType.class);