Fix Method.registerEvent for Kotlin functions (#495)

* Fix test error

* correct error message

* using none to instead exclamation mark
This commit is contained in:
sandtechnology 2020-08-17 20:41:31 +08:00 committed by GitHub
parent 236cf2540d
commit f8eed41d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -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"
}
}

View File

@ -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)

View File

@ -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) {