Skip to content

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Feb 14, 2025

Fix GH-3242

KFunction<?> function = KotlinDetector.isKotlinType(method.getDeclaringClass()) ?
KotlinReflectionUtils.findKotlinFunction(method) : null;
if (function != null && !function.getReturnType().isMarkedNullable()) {
throw new IllegalArgumentException("Kotlin function '%s' requires non-null return value".formatted(method.toString()));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure exception type and message is appropriate.

christophstrobl pushed a commit that referenced this pull request Mar 6, 2025
… result present

Closes: #3242
Original Pull Request: #3244

Signed-off-by: Yanming Zhou <[email protected]>
christophstrobl added a commit that referenced this pull request Mar 6, 2025
christophstrobl pushed a commit that referenced this pull request Mar 6, 2025
Align nullness/nullability wording. Use template methods instead of functions to create exceptions.

Original Pull Request: #3244
@christophstrobl
Copy link
Member

Thank you @quaff! Merged to main development line.

@christophstrobl christophstrobl added this to the 3.5 M2 (2025.0.0) milestone Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kotlin Interface projections nullabillity issues
3 participants