Skip to content

Remove excluded filters from mima #14915

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

Merged
merged 2 commits into from
Apr 13, 2022

Conversation

Kordyjan
Copy link
Contributor

No description provided.

@Kordyjan Kordyjan requested a review from smarter April 12, 2022 15:54
@Kordyjan Kordyjan enabled auto-merge April 12, 2022 15:54
@Kordyjan Kordyjan mentioned this pull request Apr 12, 2022
32 tasks
@smarter
Copy link
Member

smarter commented Apr 13, 2022

I think mima is complaining because of new public methods defined inside traits, but isn't that binary-compatible? (/cc @dwijnand @sjrd). In any case, these traits are all defined inside Quotes which users are not supposed to inherit (I don't know if this is enforced?), so I think we can ignore those errors.

@smarter smarter requested a review from sjrd April 13, 2022 10:31
@smarter smarter assigned sjrd and unassigned smarter Apr 13, 2022
@sjrd
Copy link
Member

sjrd commented Apr 13, 2022

Ah but they're new abstract methods in traits. That's definitely not backward binary compatible. It's only compatible if third-parties cannot extend the trait. For example because they're sealed. Or if they have a self type that cannot be fulfilled from the outside. It looks like we may be in the latter case, here, but I'm not sure.

@smarter
Copy link
Member

smarter commented Apr 13, 2022

Or if they have a self type that cannot be fulfilled from the outside.

It looks like this isn't enforced, the following compiles:

import scala.quoted.*

class A extends Quotes with runtime.QuoteUnpickler with runtime.QuoteMatching:
    val ExprMatch: ExprMatchModule = ???
    val TypeMatch: TypeMatchModule = ???
    def unpickleExpr[T](pickled: String | List[String], typeHole: (Int, Seq[Any]) => Type[? <: AnyKind], termHole: (Int, Seq[Any], Quotes) => Expr[?]): Expr[T] = ???
    def unpickleType[T <: AnyKind](pickled: String | List[String], typeHole: (Int, Seq[Any]) => Type[? <: AnyKind], termHole: (Int, Seq[Any], Quotes) => Expr[?]): Type[T] = ???
    extension(self: Expr[Any])
      def asExprOf[X](using Type[X]): Expr[X] = ???
      def isExprOf[X](using Type[X]): Boolean = ???
    val reflect: reflectModule = ???
    extension [T](self: Expr[T])
      def show: String = ???
      def matches(that: Expr[Any]): Boolean = ???
      def valueOrAbort(using FromExpr[T]): T = ???

@nicolasstucki Can we make runtime.QuoteUnpickler private to prevent people from making instances of Quotes?

@smarter smarter assigned nicolasstucki and unassigned sjrd Apr 13, 2022
@smarter
Copy link
Member

smarter commented Apr 13, 2022

Though I think we don't give any API/ABI guarantees for scala.runtime so I guess this is fine anyway?

@sjrd
Copy link
Member

sjrd commented Apr 13, 2022

Though I think we don't give any API/ABI guarantees for scala.runtime so I guess this is fine anyway?

If user-level access to scala.runtime is required to extend them, then it's fine indeed. scala.runtime is off-limit for user-level code.

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

OK, then I think this is fine as-is. @Kordyjan can you re-add the MimaFilters for abstract methods with a note that this is safe because user code is not allowed to inherit Quotes?

@smarter smarter assigned Kordyjan and unassigned nicolasstucki Apr 13, 2022
@Kordyjan Kordyjan requested a review from smarter April 13, 2022 15:53
@Kordyjan Kordyjan assigned smarter and unassigned Kordyjan Apr 13, 2022
@Kordyjan
Copy link
Contributor Author

Done!

@Kordyjan Kordyjan merged commit 8ff31c7 into scala:main Apr 13, 2022
@Kordyjan Kordyjan deleted the remove-mima-filters branch April 13, 2022 17:37
@dwijnand
Copy link
Member

can you re-add the MimaFilters for abstract methods with a note that this is safe because user code is not allowed to inherit Quotes?

If that's the case we can keep a rule as
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#*"). I normally comment those with // KEEP to make sure they don't get cleared.

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.

5 participants