Commit b265533b authored by Him188's avatar Him188

Fix warnings

parent 2d9be254
...@@ -62,7 +62,7 @@ interface MessageChain : Message, MutableList<Message> { ...@@ -62,7 +62,7 @@ interface MessageChain : Message, MutableList<Message> {
/** /**
* 提供一个类型的值. 若不存在则会抛出异常 [NoSuchElementException] * 提供一个类型的值. 若不存在则会抛出异常 [NoSuchElementException]
*/ */
inline operator fun <reified T : Message> MessageChain.getValue(thisRef: Any?, property: KProperty<*>): T = this.first<T>() as T inline operator fun <reified T : Message> MessageChain.getValue(thisRef: Any?, property: KProperty<*>): T = this.first()
/** /**
* 构造无初始元素的可修改的 [MessageChain]. 初始大小将会被设定为 8 * 构造无初始元素的可修改的 [MessageChain]. 初始大小将会被设定为 8
...@@ -430,26 +430,4 @@ internal inline class SingleMessageChainImpl( ...@@ -430,26 +430,4 @@ internal inline class SingleMessageChainImpl(
override operator fun contains(element: Message): Boolean = element == delegate override operator fun contains(element: Message): Boolean = element == delegate
override val size: Int get() = 1 override val size: Int get() = 1
// endregion // endregion
} }
\ No newline at end of file
@Suppress("FunctionName")
private fun <E> EmptyMutableIterator(): MutableIterator<E> = object : MutableIterator<E> {
override fun hasNext(): Boolean = false
override fun next(): E = throw NoSuchElementException()
override fun remove() = throw NoSuchElementException()
}
@Suppress("FunctionName")
private fun <E> EmptyMutableListIterator(): MutableListIterator<E> = object : MutableListIterator<E> {
override fun hasPrevious(): Boolean = false
override fun nextIndex(): Int = -1
override fun previous(): E = throw NoSuchElementException()
override fun previousIndex(): Int = -1
override fun add(element: E) = throw UnsupportedOperationException()
override fun hasNext(): Boolean = false
override fun next(): E = throw NoSuchElementException()
override fun remove() = throw NoSuchElementException()
override fun set(element: E) = throw UnsupportedOperationException()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment