Skip to content

Commit

Permalink
Merge pull request #696 from raboof/consider-missing-signature-equiva…
Browse files Browse the repository at this point in the history
…lent-to-nongeneric
  • Loading branch information
dwijnand authored Apr 29, 2022
2 parents 1f5c4ce + 6e017db commit 0b42f3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
15 changes: 12 additions & 3 deletions core/src/main/scala/com/typesafe/tools/mima/core/Signature.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,18 @@ class Signature(private val signature: String) {
}

def matches(newer: Signature, isConstructor: Boolean): Boolean = {
return (signature == newer.signature) ||
(isConstructor && hasMatchingCtorSig(newer.signature)) ||
canonicalized == newer.canonicalized
// If the signature is identical obviously it matches
(signature == newer.signature) ||
// Consider missing signatures identical to non-generic ones.
// This is particularly helpful because between Scala 3.1.1 and 3.1.2 the compiler
// started emitting signatures for non-generic methods. Incompatibilities for those
// will be caught through mismatching descriptors anyway.
(signature == "" && newer.signature.indexOf('<') == -1) ||
(newer.signature == "" && signature.indexOf('<') == -1) ||
// Special rules for constructors
(isConstructor && hasMatchingCtorSig(newer.signature)) ||
// Also match when the signature only differs in the name of a type parameter
canonicalized == newer.canonicalized
}

// Special case for scala#7975
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 0b42f3a

Please sign in to comment.