Fix compiler error

This commit is contained in:
Him188 2020-09-10 17:41:14 +08:00
parent 7fe2d13544
commit 76c277a9e7

View File

@ -22,7 +22,6 @@ import net.mamoe.mirai.console.command.CommandSender
import net.mamoe.mirai.contact.Contact import net.mamoe.mirai.contact.Contact
import net.mamoe.mirai.contact.User import net.mamoe.mirai.contact.User
import net.mamoe.mirai.message.data.Message import net.mamoe.mirai.message.data.Message
import kotlin.internal.InlineOnly
import kotlin.internal.LowPriorityInOverloadResolution import kotlin.internal.LowPriorityInOverloadResolution
/** /**
@ -623,27 +622,23 @@ public suspend fun Flow<MessageScope>.toMessageScope(): MessageScope { // Flow<A
// [MessageScope] 实现 // [MessageScope] 实现
@PublishedApi @PublishedApi
@InlineOnly
internal inline fun MessageScope.asMessageScope(): MessageScope = this internal inline fun MessageScope.asMessageScope(): MessageScope = this
@InlineOnly
private inline fun MessageScope?.asMessageScopeOrNoop(): MessageScope = this?.asMessageScope() ?: NoopMessageScope private inline fun MessageScope?.asMessageScopeOrNoop(): MessageScope = this?.asMessageScope() ?: NoopMessageScope
@InlineOnly
private inline fun Contact?.asMessageScopeOrNoop(): MessageScope = this?.asMessageScope() ?: NoopMessageScope private inline fun Contact?.asMessageScopeOrNoop(): MessageScope = this?.asMessageScope() ?: NoopMessageScope
@InlineOnly
private inline fun CommandSender?.asMessageScopeOrNoop(): MessageScope = this?.asMessageScope() ?: NoopMessageScope private inline fun CommandSender?.asMessageScopeOrNoop(): MessageScope = this?.asMessageScope() ?: NoopMessageScope
@InlineOnly
private inline fun createScopeDelegate(o: CommandSender) = CommandSenderAsMessageScope(o) private inline fun createScopeDelegate(o: CommandSender) = CommandSenderAsMessageScope(o)
@InlineOnly
private inline fun createScopeDelegate(o: Contact) = ContactAsMessageScope(o) private inline fun createScopeDelegate(o: Contact) = ContactAsMessageScope(o)
private fun MessageScope.asSequence(): Sequence<MessageScope> { internal fun MessageScope.asSequence(): Sequence<MessageScope> {
return if (this is CombinedScope) { return if (this is CombinedScope) {
sequenceOf(this.first.asSequence(), this.second.asSequence()).flatten() val a = this.first.asSequence()
val b = this.second.asSequence() // don't inline. fuck compilers
sequenceOf(a, b).flatten()
} else sequenceOf(this) } else sequenceOf(this)
} }