Skip to content

Commit

Permalink
Setup to ignore new experimental methods too
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Aug 23, 2021
1 parent 0750167 commit b19ae44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ object TastyUnpickler {

final case class ClsDef(name: TypeName, template: Template, annots: List[Annot]) extends Tree { def show = s"${annots.map("" + _ + " ").mkString}class $name$template" }
final case class Template(meths: List[DefDef]) extends Tree { def show = s"${meths.map("\n " + _).mkString}" }
final case class DefDef(name: Name, annots: List[Annot] = Nil) extends Tree { def show = s"${annots.map("" + _ + " ").mkString} def $name" }
final case class DefDef(name: Name, annots: List[Annot] = Nil) extends Tree { def show = s"${annots.map("" + _ + " ").mkString}def $name" }

sealed trait Type extends Tree
final case class UnknownType(tag: Int) extends Type { def show = s"UnknownType(${astTagToString(tag)})" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ private[analyze] object MethodChecker {
private def checkDeferredMethodsProblems(oldclazz: ClassInfo, newclazz: ClassInfo): List[Problem] = {
for {
newmeth <- newclazz.deferredMethods.iterator
if !newmeth.isExperimental
problem <- oldclazz.lookupMethods(newmeth).find(_.descriptor == newmeth.descriptor) match {
case None => Some(ReversedMissingMethodProblem(newmeth))
case Some(oldmeth) if newclazz.isClass && oldmeth.isConcrete => Some(ReversedAbstractMethodProblem(newmeth))
Expand All @@ -158,6 +159,7 @@ private[analyze] object MethodChecker {
newInheritedType <- diffInheritedTypes.iterator
// if `newInheritedType` is a trait, then the trait's concrete methods should be counted as deferred methods
newDeferredMethod <- newInheritedType.deferredMethodsInBytecode
if !newDeferredMethod.isExperimental
// checks that the newDeferredMethod did not already exist in one of the oldclazz supertypes
if noInheritedMatchingMethod(oldclazz, newDeferredMethod)(_ => true) &&
// checks that no concrete implementation of the newDeferredMethod is provided by one of the newclazz supertypes
Expand Down

0 comments on commit b19ae44

Please sign in to comment.