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

Consider missing signature equivalent to non-generic one #696

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.