mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin][inspection] fix SOE from UnnecessaryOptInAnnotationInspection
^KTIJ-22084 Fixed GitOrigin-RevId: b5c605bb7cc5ba1420e96f329632545ba84816d1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
05e3463f19
commit
d5e406563b
+6
-1
@@ -236,7 +236,12 @@ private class MarkerCollector(private val resolutionFacade: ResolutionFacade) {
|
||||
* @param moduleApiVersion the API version of the current module to check `@WasExperimental` annotations
|
||||
*/
|
||||
private fun KotlinType.collectMarkers(moduleApiVersion: ApiVersion) {
|
||||
arguments.forEach { it.type.collectMarkers(moduleApiVersion) }
|
||||
arguments.forEach {
|
||||
if (!it.isStarProjection) {
|
||||
it.type.collectMarkers(moduleApiVersion)
|
||||
}
|
||||
}
|
||||
|
||||
val descriptor = this.constructor.declarationDescriptor ?: return
|
||||
descriptor.collectMarkers(moduleApiVersion)
|
||||
}
|
||||
|
||||
+5
@@ -15414,6 +15414,11 @@ public abstract class LocalInspectionTestGenerated extends AbstractLocalInspecti
|
||||
runTest("testData/inspectionsLocal/unnecessaryOptInAnnotation/noArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("recursive.kt")
|
||||
public void testRecursive() throws Exception {
|
||||
runTest("testData/inspectionsLocal/unnecessaryOptInAnnotation/recursive.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("redundantClassTwoMarkers.kt")
|
||||
public void testRedundantClassTwoMarkers() throws Exception {
|
||||
runTest("testData/inspectionsLocal/unnecessaryOptInAnnotation/redundantClassTwoMarkers.kt");
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// WITH_STDLIB
|
||||
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||
|
||||
@RequiresOptIn
|
||||
annotation class Marker
|
||||
|
||||
lateinit var variable: RecType<*>
|
||||
|
||||
@OptIn(<caret>Marker::class)
|
||||
fun t() {
|
||||
variable
|
||||
}
|
||||
|
||||
interface RecType<R : RecType<R>>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// WITH_STDLIB
|
||||
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||
|
||||
@RequiresOptIn
|
||||
annotation class Marker
|
||||
|
||||
lateinit var variable: RecType<*>
|
||||
|
||||
fun t() {
|
||||
variable
|
||||
}
|
||||
|
||||
interface RecType<R : RecType<R>>
|
||||
Reference in New Issue
Block a user