Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure annotated service with Kotlin suspend function supports nullable parameters #5638

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

minwoox
Copy link
Contributor

@minwoox minwoox commented Apr 26, 2024

Motivation:
A regression was identified where an annotated service with a Kotlin suspend function does not work as expected when the parameter is nullable.

Modifications:

  • Updated the function call to include null parameters when invoking kFunction.callSuspendBy().

Result:

  • The annotated service with a Kotlin suspend function works correctly even with a nullable parameter.

…le parameters.

Motivation:
A regression was identified where an annotated service with a Kotlin suspend function does not work as expected when the parameter is nullable.

Modifications:
- Updated the function call to include null parameters when invoking `kFunction.callSuspendBy()`.

Result:
- The annotated service with a Kotlin suspend function works correctly even with a nullable parameter.
@minwoox minwoox added this to the 1.28.3 milestone Apr 26, 2024
@minwoox minwoox added the defect label Apr 26, 2024
Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @minwoox!

methods.size == 1,
"Unable to find a single box-impl synthetic static method in %s",
classifier.java.name,
if (!parameter.isOptional || args[index] != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱

@minwoox minwoox merged commit e212298 into line:main Apr 26, 2024
15 of 16 checks passed
@minwoox minwoox deleted the fix_null_kotlin_suspend branch April 26, 2024 01:52
minwoox added a commit that referenced this pull request Apr 26, 2024
…le parameters (#5638)

Motivation:
A regression was identified where an annotated service with a Kotlin suspend function does not work as expected when the parameter is nullable.

Modifications:
- Updated the function call to include null parameters when invoking `kFunction.callSuspendBy()`.

Result:
- The annotated service with a Kotlin suspend function works correctly even with a nullable parameter.
Dogacel pushed a commit to Dogacel/armeria that referenced this pull request Jun 8, 2024
…le parameters (line#5638)

Motivation:
A regression was identified where an annotated service with a Kotlin suspend function does not work as expected when the parameter is nullable.

Modifications:
- Updated the function call to include null parameters when invoking `kFunction.callSuspendBy()`.

Result:
- The annotated service with a Kotlin suspend function works correctly even with a nullable parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants