Skip to content

Conversation

@raphw
Copy link
Member

@raphw raphw commented Dec 16, 2024

Improve the error message of sealed types to suggest mocking a non-abstract subclass which allows to use a mock by type substitution.

…hen mocking a sealed interface or abstract class.
Copy link
Contributor

@TimvdLippe TimvdLippe left a comment

Choose a reason for hiding this comment

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

Looks good to me. Seems like we have duplicate code between the inline mockmakers. Shall we deduplicate that?

@raphw
Copy link
Member Author

raphw commented Dec 17, 2024

Can you point to where? If it's the same checks, certainly, to make them behave consistent.

@TimvdLippe
Copy link
Contributor

Ah it was added here: #3534 Was it accidentally reverted by @bric3 later? Not sure if I am following what happened to these changes.

@bric3
Copy link
Contributor

bric3 commented Dec 17, 2024

This is certainly weird. The diff though looks the same.

#3534 was committed as 7c277ac on main.

Note I tried to handle that in #3533, but the CI is failing in an obscure way so nothing changed on that front.

@bric3
Copy link
Contributor

bric3 commented Dec 17, 2024

This PR #3552
#3552

#3534
#3534

@raphw
Copy link
Member Author

raphw commented Dec 17, 2024

I was confused myself, but thought I just never created a PR.

@TimvdLippe
Copy link
Contributor

Given that 7c277ac exists on main, I don't think we need this PR anymore. Let's revisit when it turns out we are missing something.

@TimvdLippe TimvdLippe closed this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants