mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-05 00:10:13 +08:00
Fix Method.registerEvent for Kotlin functions (#495)
* Fix test error * correct error message * using none to instead exclamation mark
This commit is contained in:
parent
236cf2540d
commit
f8eed41d62
@ -363,7 +363,7 @@ internal class GroupImpl(
|
||||
source = it
|
||||
}.sendAndExpect<MessageSvcPbSendMsg.Response>().let {
|
||||
check(it is MessageSvcPbSendMsg.Response.SUCCESS) {
|
||||
"Send temp message failed: $it"
|
||||
"Send group message failed: $it"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ internal suspend fun <T : User> Friend.sendMessageImpl(
|
||||
source = it
|
||||
}.sendAndExpect<MessageSvcPbSendMsg.Response>().let {
|
||||
check(it is MessageSvcPbSendMsg.Response.SUCCESS) {
|
||||
"Send temp message failed: $it"
|
||||
"Send friend message failed: $it"
|
||||
}
|
||||
}
|
||||
friendReceiptConstructor(source)
|
||||
|
@ -109,7 +109,7 @@ internal fun Method.registerEvent(
|
||||
require(!kotlinFunction.returnType.isMarkedNullable) {
|
||||
"Kotlin event handlers cannot have nullable return type."
|
||||
}
|
||||
require(kotlinFunction.parameters.any { it.type.isMarkedNullable }) {
|
||||
require(kotlinFunction.parameters.none { it.type.isMarkedNullable }) {
|
||||
"Kotlin event handlers cannot have nullable parameter type."
|
||||
}
|
||||
when (kotlinFunction.returnType.classifier) {
|
||||
|
Loading…
Reference in New Issue
Block a user