Skip to content

Conversation

@david-kubecka
Copy link
Contributor

@david-kubecka david-kubecka commented Feb 28, 2025

It's a valid case that function returns null value. The same can probably be stated regarding the error value. While here I cannot imagine a use case (yet) I think it's better for the lib to be as general as possible.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the type constraints in the RaiseAssert library to allow nullable error and value types by changing from Any to Any? constraints. This enables handling cases where functions may return null values or errors.

  • Changes generic type constraints from ERROR : Any, VALUE : Any to ERROR : Any?, VALUE : Any?
  • Updates all related function signatures and companion object methods
  • Modifies the sealed interface RaiseResult and its data classes to support nullable types

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/main/kotlin/in/rcard/assertj/arrowcore/RaiseAssert.kt Updates class definition and companion object methods to accept nullable ERROR and VALUE types
src/main/kotlin/in/rcard/assertj/arrowcore/AbstractRaiseAssert.kt Updates abstract class and RaiseResult interface to support nullable type constraints
Comments suppressed due to low confidence (1)

src/main/kotlin/in/rcard/assertj/arrowcore/AbstractRaiseAssert.kt:86

  • The return type AbstractObjectAssert<*, out ERROR> may not handle nullable ERROR types properly. When ERROR is nullable, this could lead to assertion issues since AbstractObjectAssert might not be designed to handle null values effectively.
     * @param expectedError the expected error raised by the function.

@rcardin rcardin added the bug Something isn't working label Aug 6, 2025
Copy link
Collaborator

@rcardin rcardin left a comment

Choose a reason for hiding this comment

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

LGTM 👏 (sorry for the delay)

@rcardin rcardin added this to the v1.2.2 milestone Aug 6, 2025
@rcardin rcardin merged commit 5ff6ca0 into assertj:main Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants