Skip to content

Commit

Permalink
Apply Kotlin inspection "Unnecessary '@OptIn' annotation" on whole pr…
Browse files Browse the repository at this point in the history
…oject

GitOrigin-RevId: 08826c356323606bead3c87ed0133ddb6d172ce5
  • Loading branch information
abelkov authored and intellij-monorepo-bot committed May 27, 2023
1 parent c7dab8a commit 17d751f
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ fun executeShellCommand(device: IDevice, command: String, receiver: IShellOutput
* Coroutine-based wrapper around DDMLib's [IDevice.executeShellCommand], returning a Flow of shell output,
* like that produced by [AdbDeviceServices.shell].
*/
@OptIn(ExperimentalCoroutinesApi::class)
fun <T> executeShellCommand(device: IDevice, command: String, shellCollector: ShellCollector<T>): Flow<T> =
flow {
shellCollector.start(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ interface CallbackFlowWithDisposableScope<T> : CoroutineScope {
*
* This allows for any callbacks to use that [Disposable] and dispose the listeners when the flow is not needed.
*/
@OptIn(ExperimentalCoroutinesApi::class)
fun <T> disposableCallbackFlow(debugName: String,
logger: Logger? = null,
parentDisposable: Disposable? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class ComposeIrGenerationExtension(
private val reportsDestination: String? = null
) : IrGenerationExtension {
var metrics: ModuleMetrics = EmptyModuleMetrics
@OptIn(ObsoleteDescriptorBasedAPI::class)
override fun generate(
moduleFragment: IrModuleFragment,
pluginContext: IrPluginContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ abstract class AbstractComposeLowering(
body: IrBlockBodyBuilder.(IrFunction) -> Unit
) = irLambdaExpression(this.startOffset, this.endOffset, descriptor, type, body)

@OptIn(ObsoleteDescriptorBasedAPI::class)
protected fun IrBuilderWithScope.irLambdaExpression(
startOffset: Int,
endOffset: Int,
Expand Down Expand Up @@ -603,7 +602,6 @@ abstract class AbstractComposeLowering(
)
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
protected fun irCall(
symbol: IrFunctionSymbol,
origin: IrStatementOrigin? = null,
Expand All @@ -628,11 +626,9 @@ abstract class AbstractComposeLowering(
}
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
protected fun IrType.binaryOperator(name: Name, paramType: IrType): IrFunctionSymbol =
context.symbols.getBinaryOperator(name, this, paramType)

@OptIn(ObsoleteDescriptorBasedAPI::class)
protected fun IrType.unaryOperator(name: Name): IrFunctionSymbol =
context.symbols.getUnaryOperator(name, this)

Expand Down Expand Up @@ -1037,7 +1033,6 @@ abstract class AbstractComposeLowering(
)
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
protected fun irLambda(function: IrFunction, type: IrType): IrExpression {
return irBlock(
type,
Expand Down Expand Up @@ -1260,7 +1255,6 @@ abstract class AbstractComposeLowering(

// Construct a reference to the JVM specific <unsafe-coerce> intrinsic.
// This code should be kept in sync with the declaration in JvmSymbols.kt.
@OptIn(ObsoleteDescriptorBasedAPI::class)
private val unsafeCoerceIntrinsic: IrSimpleFunctionSymbol? by lazy {
if (context.platform.isJvm()) {
context.irFactory.buildFun {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,6 @@ class ComposableFunctionBodyTransformer(
return hash
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun functionSourceKey(): Int {
val fn = currentFunctionScope.function
if (fn is IrSimpleFunction) {
Expand Down Expand Up @@ -1979,7 +1978,6 @@ class ComposableFunctionBodyTransformer(
irIf(isTraceInProgress, body)
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun irTraceEventStart(key: IrExpression, declaration: IrFunction): IrExpression? =
traceEventStartFunction?.let { traceEventStart ->
val startOffset = declaration.body!!.startOffset
Expand Down Expand Up @@ -2053,7 +2051,6 @@ class ComposableFunctionBodyTransformer(
return irMethodCall(irCurrentComposer(), endRestartGroupFunction)
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun irCache(
startOffset: Int,
endOffset: Int,
Expand Down Expand Up @@ -2182,7 +2179,6 @@ class ComposableFunctionBodyTransformer(
)
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun irCall(
function: IrFunction,
startOffset: Int = UNDEFINED_OFFSET,
Expand Down Expand Up @@ -2674,7 +2670,6 @@ class ComposableFunctionBodyTransformer(
}
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
override fun visitCall(expression: IrCall): IrExpression {
if (expression.isTransformedComposableCall() || expression.isSyntheticComposableCall()) {
return visitComposableCall(expression)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ class ComposerTypeRemapper(
return annotations.hasAnnotation(ComposeFqNames.Composable)
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private val IrConstructorCall.annotationClass
get() = this.symbol.owner.returnType.classifierOrNull

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ class ComposerLambdaMemoization(
return result
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun irCurrentComposer(): IrExpression {
val currentComposerSymbol = getTopLevelPropertyGetter(
ComposeFqNames.fqNameFor("currentComposer")
Expand Down Expand Up @@ -997,7 +996,6 @@ class ComposerLambdaMemoization(
return this
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun IrExpression?.isNullOrStable() = this == null || stabilityOf(this).knownStable()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ class IrSourcePrinterVisitor(

private var isInNotCall = false

@OptIn(ObsoleteDescriptorBasedAPI::class)
override fun visitCall(expression: IrCall) {
val function = expression.symbol.owner
val name = function.name.asString()
Expand Down Expand Up @@ -772,7 +771,6 @@ class IrSourcePrinterVisitor(
println("}")
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
override fun visitReturn(expression: IrReturn) {
val value = expression.value
// only print the return statement directly if it is not a lambda
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ open class LiveLiteralTransformer(
putValueArgument(0, irConst(file))
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun irLiveLiteralGetter(
key: String,
literalValue: IrExpression,
Expand Down Expand Up @@ -396,7 +395,6 @@ open class LiveLiteralTransformer(
}
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
override fun visitConst(expression: IrConst<*>): IrExpression {
when (expression.kind) {
IrConstKind.Null -> return expression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,12 @@ class CreateDecoysTransformer(
}
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun IrFunction.decoyImplementationName(): Name {
return dexSafeName(
Name.identifier(name.asString() + IMPLEMENTATION_FUNCTION_SUFFIX)
)
}

@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun IrFunction.copyWithName(
newName: Name,
factory: (IrFunctionBuilder.() -> Unit) -> IrFunction = context.irFactory::buildFun
Expand Down

0 comments on commit 17d751f

Please sign in to comment.