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

Don't report ReversedMissingMethodProblem for sealed traits #817

Open
raboof opened this issue Jun 22, 2024 · 1 comment
Open

Don't report ReversedMissingMethodProblem for sealed traits #817

raboof opened this issue Jun 22, 2024 · 1 comment

Comments

@raboof
Copy link
Contributor

raboof commented Jun 22, 2024

If I understand correctly, we report ReversedMissingMethodProblem when checking for backwards compatibility because if a method was added to trait A, and trait B is compiled against an older version of A, trait B might be missing forwarders that a project that depends on both B and the newer A could run into.

If I understand that correctly, then we could suppress ReversedMissingMethodProblem for sealed traits, right?

@JD557
Copy link

JD557 commented Jun 22, 2024

I was thinking a bit about this and, if I understand the problem correctly, you need more guarantees than just "being a sealed trait" - It needs to be a sealed trait that is only extended by classes.

For example:

sealed trait Sealed

trait Unsealed extends Sealed

In this case, it´s possible for code outside of the file to extend Unsealed, which would pretty much break any bincompat guarantees that you get by having Sealed marked as sealed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants