Skip to content

Commit ac7c419

Browse files
committed
Suppress NOTHING_TO_INLINE warnings
1 parent 16932c8 commit ac7c419

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

kmp-observableviewmodel-core/src/androidxMain/kotlin/com/rickclephas/kmp/observableviewmodel/ViewModel.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public actual abstract class ViewModel: AndroidXViewModel {
7070
* If [onCleared][ViewModel.onCleared] has already been called,
7171
* the provided resource will not be added and will be closed immediately.
7272
*/
73-
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
73+
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
7474
public actual inline fun ViewModel.addCloseable(key: String, closeable: AutoCloseable): Unit =
7575
addCloseable(key, closeable)
7676

@@ -81,14 +81,14 @@ public actual inline fun ViewModel.addCloseable(key: String, closeable: AutoClos
8181
* If [onCleared][ViewModel.onCleared] has already been called,
8282
* the provided resource will not be added and will be closed immediately.
8383
*/
84-
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
84+
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
8585
public actual inline fun ViewModel.addCloseable(closeable: AutoCloseable): Unit =
8686
addCloseable(closeable)
8787

8888
/**
8989
* Returns the [AutoCloseable] resource associated to the given [key],
9090
* or `null` if such a [key] is not present in this [ViewModel].
9191
*/
92-
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
92+
@Suppress("EXTENSION_SHADOWED_BY_MEMBER", "NOTHING_TO_INLINE")
9393
public actual inline fun <T : AutoCloseable> ViewModel.getCloseable(key: String): T? =
9494
getCloseable(key)

kmp-observableviewmodel-core/src/appleMain/kotlin/com/rickclephas/kmp/observableviewmodel/NativeViewModelScope.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ internal class NativeViewModelScope(
2626
/**
2727
* Casts `this` [ViewModelScope] to a [NativeViewModelScope].
2828
*/
29+
@Suppress("NOTHING_TO_INLINE")
2930
internal inline fun ViewModelScope.asNative(): NativeViewModelScope = this as NativeViewModelScope

kmp-observableviewmodel-core/src/commonMain/kotlin/com/rickclephas/kmp/observableviewmodel/ViewModelScopeUtils.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public inline val ViewModelScope.isActive: Boolean
1616
/**
1717
* @see kotlinx.coroutines.async
1818
*/
19+
@Suppress("NOTHING_TO_INLINE")
1920
public inline fun <T> ViewModelScope.async(
2021
context: CoroutineContext = EmptyCoroutineContext,
2122
start: CoroutineStart = CoroutineStart.DEFAULT,
@@ -25,11 +26,13 @@ public inline fun <T> ViewModelScope.async(
2526
/**
2627
* @see kotlinx.coroutines.ensureActive
2728
*/
29+
@Suppress("NOTHING_TO_INLINE")
2830
public inline fun ViewModelScope.ensureActive(): Unit = coroutineScope.ensureActive()
2931

3032
/**
3133
* @see kotlinx.coroutines.launch
3234
*/
35+
@Suppress("NOTHING_TO_INLINE")
3336
public inline fun ViewModelScope.launch(
3437
context: CoroutineContext = EmptyCoroutineContext,
3538
start: CoroutineStart = CoroutineStart.DEFAULT,
@@ -39,6 +42,7 @@ public inline fun ViewModelScope.launch(
3942
/**
4043
* @see kotlinx.coroutines.channels.produce
4144
*/
45+
@Suppress("NOTHING_TO_INLINE")
4246
@ExperimentalCoroutinesApi
4347
public inline fun <E> ViewModelScope.produce(
4448
context: CoroutineContext = EmptyCoroutineContext,

kmp-observableviewmodel-core/src/nonAppleMain/kotlin/com/rickclephas/kmp/observableviewmodel/StateFlow.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import kotlinx.coroutines.flow.*
55
/**
66
* @see kotlinx.coroutines.flow.MutableStateFlow
77
*/
8+
@Suppress("NOTHING_TO_INLINE")
89
public actual inline fun <T> MutableStateFlow(
910
viewModelScope: ViewModelScope,
1011
value: T
@@ -13,6 +14,7 @@ public actual inline fun <T> MutableStateFlow(
1314
/**
1415
* @see kotlinx.coroutines.flow.stateIn
1516
*/
17+
@Suppress("NOTHING_TO_INLINE")
1618
public actual inline fun <T> Flow<T>.stateIn(
1719
viewModelScope: ViewModelScope,
1820
started: SharingStarted,

0 commit comments

Comments
 (0)