Skip to content

Commit

Permalink
Mima: allow primary Dialect.this constructor (#3616)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Mar 7, 2024
1 parent 93cc902 commit eab853f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion project/Mima.scala
Expand Up @@ -15,7 +15,17 @@ object Mima {
(ref.fullName, ref.isPublic && ref.scopedPrivateSuff.isEmpty)
case problem: MemberProblem =>
val ref = problem.ref
val accessible = !ref.nonAccessible && ref.scopedPrivatePrefix.isEmpty
val accessible = !ref.nonAccessible && ref.scopedPrivatePrefix.isEmpty &&
(ref.fullName match {
case "scala.meta.Dialect.this" =>
// exclude ctor with the longest method signature (aka, primary)
// for some reason, `private[meta]` on the primary ctor is not visible
val descriptorLength = ref.descriptor.length
!ref.owner.methods.get(MemberInfo.ConstructorName).forall { ctor =>
(ctor eq ref) || ctor.descriptor.length < descriptorLength
}
case _ => true
})
(ref.fullName, accessible)
}
def include = fullName.startsWith("scala.meta.")
Expand Down

0 comments on commit eab853f

Please sign in to comment.