Fix "Backing property is only allowed when a matching property or function exists"
This commit is contained in:
parent
f1c76c196f
commit
e22ecb68c3
1 changed files with 5 additions and 6 deletions
|
|
@ -75,22 +75,21 @@ class AsyncDataKtTest {
|
||||||
private class TestableMutableState<T>(
|
private class TestableMutableState<T>(
|
||||||
value: T
|
value: T
|
||||||
) : MutableState<T> {
|
) : MutableState<T> {
|
||||||
@Suppress("ktlint:standard:property-naming")
|
private val deque = ArrayDeque(listOf(value))
|
||||||
private val _deque = ArrayDeque<T>(listOf(value))
|
|
||||||
|
|
||||||
override var value: T
|
override var value: T
|
||||||
get() = _deque.last()
|
get() = deque.last()
|
||||||
set(value) {
|
set(value) {
|
||||||
_deque.addLast(value)
|
deque.addLast(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the states that were set in the order they were set.
|
* Returns the states that were set in the order they were set.
|
||||||
*/
|
*/
|
||||||
fun popFirst(): T = _deque.removeFirst()
|
fun popFirst(): T = deque.removeFirst()
|
||||||
|
|
||||||
fun assertNoMoreValues() {
|
fun assertNoMoreValues() {
|
||||||
assertThat(_deque).isEmpty()
|
assertThat(deque).isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
override operator fun component1(): T = value
|
override operator fun component1(): T = value
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue