[FIR] KT-46483: Forbid annotations in where Clauses

Merge-request: KT-MR-7208
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
This commit is contained in:
Nikolay Lunyak
2022-09-28 13:38:18 +00:00
committed by Space
parent a20ce06102
commit f578381726
37 changed files with 462 additions and 20 deletions
@@ -19,10 +19,15 @@ package org.jetbrains.kotlin.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.KtNodeTypes;
import org.jetbrains.kotlin.psi.psiUtil.KtPsiUtilKt;
import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes;
public class KtTypeConstraint extends KtElementImplStub<KotlinPlaceHolderStub<KtTypeConstraint>> {
import java.util.List;
public class KtTypeConstraint extends KtElementImplStub<KotlinPlaceHolderStub<KtTypeConstraint>>
implements KtAnnotated, KtAnnotationsContainer {
public KtTypeConstraint(@NotNull ASTNode node) {
super(node);
}
@@ -45,4 +50,16 @@ public class KtTypeConstraint extends KtElementImplStub<KotlinPlaceHolderStub<Kt
public KtTypeReference getBoundTypeReference() {
return getStubOrPsiChild(KtStubElementTypes.TYPE_REFERENCE);
}
@Override
@NotNull
public List<KtAnnotation> getAnnotations() {
return findChildrenByType(KtNodeTypes.ANNOTATION);
}
@Override
@NotNull
public List<KtAnnotationEntry> getAnnotationEntries() {
return KtPsiUtilKt.collectAnnotationEntriesFromStubOrPsi(this);
}
}