Skip to content

Commit

Permalink
improve Kotlin support
Browse files Browse the repository at this point in the history
  • Loading branch information
emattheis committed Jan 7, 2025
1 parent 4a42b5a commit e83c0c0
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -771,12 +771,13 @@ static String getPathPrefix(IndexView index, DotName enclosingClassName) {

private void validateOnPingMessage(Callback callback) {
if (KotlinUtils.isKotlinMethod(callback.method)) {
if (!callback.isReturnTypeVoid() && !callback.isKotlinSuspendFunctionReturningUnit()) {
if (!callback.isReturnTypeVoid() && !isUniVoid(callback.returnType())
&& !callback.isKotlinSuspendFunctionReturningUnit()) {
throw new WebSocketServerException(
"@OnPingMessage callback must return Unit: " + callback.asString());
"@OnPingMessage callback must return Unit or Uni<Void>: " + callback.asString());
}
} else {
if (callback.returnType().kind() != Kind.VOID && !WebSocketProcessor.isUniVoid(callback.returnType())) {
if (!callback.isReturnTypeVoid() && !isUniVoid(callback.returnType())) {
throw new WebSocketServerException(
"@OnPingMessage callback must return void or Uni<Void>: " + callback.asString());
}
Expand Down

0 comments on commit e83c0c0

Please sign in to comment.