mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-23 14:20:24 +08:00
Explict operator
modifier for fun subList
This commit is contained in:
parent
89b39de1ff
commit
618e6d9c4b
@ -278,7 +278,7 @@ internal inline class MessageChainImpl constructor(
|
||||
* Elements will not be instances of [MessageChain]
|
||||
*/
|
||||
private val delegate: MutableList<Message>
|
||||
) : Message, MutableList<Message>,
|
||||
) : Message, MutableList<Message>, // do not `by delegate`, bcz Inline class cannot implement an interface by delegation
|
||||
MessageChain {
|
||||
|
||||
constructor(vararg messages: Message) : this(messages.toMutableList())
|
||||
@ -316,7 +316,7 @@ internal inline class MessageChainImpl constructor(
|
||||
override fun retainAll(elements: Collection<Message>): Boolean = delegate.retainAll(elements)
|
||||
override fun set(index: Int, element: Message): Message = delegate.set(index, element)
|
||||
override fun subList(fromIndex: Int, toIndex: Int): MutableList<Message> = delegate.subList(fromIndex, toIndex)
|
||||
override fun iterator(): MutableIterator<Message> = delegate.iterator()
|
||||
override operator fun iterator(): MutableIterator<Message> = delegate.iterator()
|
||||
override operator fun contains(element: Message): Boolean = delegate.contains(element)
|
||||
override val size: Int get() = delegate.size
|
||||
// endregion
|
||||
|
Loading…
Reference in New Issue
Block a user