Skip to content

Commit

Permalink
Merge pull request #663 from som-snytt/x3
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand authored Sep 29, 2021
2 parents c4df0f0 + e5868ea commit 571ed1d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inThisBuild(Seq(
),
scmInfo := Some(ScmInfo(url("https://github.com/lightbend/mima"), "scm:git:[email protected]:lightbend/mima.git")),
dynverVTagPrefix := false,
scalacOptions := Seq("-feature", "-deprecation", "-Xlint"),
scalacOptions ++= Seq("-feature", "-Xsource:3", "-Xlint", "-Wconf:cat=deprecation&msg=Stream|JavaConverters:s"),
resolvers ++= (if (isStaging) List(stagingResolver) else Nil),
publishTo := Some(if (isSnapshot.value) Opts.resolver.sonatypeSnapshots else Opts.resolver.sonatypeStaging),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ object MimaUnpickler {
}

def readEnd(): Int = buf.readNat() + buf.readIndex
def readNameRef(): Name = at(buf.readNat(), readName)
def readNameRef(): Name = at(buf.readNat(), () => readName())
def readSymRef(): SymInfo = at(buf.readNat(), () => readSym(buf.readByte()))
def readSymbolRef(): SymbolInfo = at(buf.readNat(), () => readSymbol(buf.readByte()))
def readTypeRef(): TypeInfo = at(buf.readNat(), () => readType())
Expand Down Expand Up @@ -136,7 +136,7 @@ object MimaUnpickler {
}
}

for (num <- index.indices) at(num, readEntry)
for (num <- index.indices) at(num, () => readEntry())

if (doPrint) {
entries.iterator.zipWithIndex.filter(_._1 != null).foreach { case (entry, num) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ object PicklePrinter {
/** Returns the buffer as a sequence of (Int, Array[Byte]) representing
* (tag, data) of the individual entries. Saves and restores buffer state.
*/
private def toIndexedSeq(buf: PickleBuffer): IndexedSeq[(Int, Array[Byte])] = {
private def toIndexedSeq(buf: PickleBuffer): IndexedSeq[(Int, Array[Byte])] = (
for (idx <- buf.createIndex) yield {
buf.atIndex(idx) {
val tag = buf.readByte()
val len = buf.readNat()
tag -> buf.bytes.slice(buf.readIndex, buf.readIndex + len)
}
}
}
).toIndexedSeq
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ private[mima] object ProblemReporting {
val VersionRegex = """(\d+)\.?(\d+)?\.?(.*)?""".r
def int(versionPart: String) =
Try(versionPart.replace("x", Short.MaxValue.toString).filter(_.isDigit).toInt).getOrElse(0)
Ordering[(Int, Int, Int)].on[String] { case VersionRegex(x, y, z) => (int(x), int(y), int(z)) }
Ordering[(Int, Int, Int)].on[String] {
case VersionRegex(x, y, z) => (int(x), int(y), int(z))
case bad => throw new IllegalArgumentException(bad)
}
}

def isReported(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ object TastyFormat {
* Name = UTF8 Length UTF8-CodePoint*
* QUALIFIED Length qualified_NameRef selector_NameRef -- A.B
* EXPANDED Length qualified_NameRef selector_NameRef -- A$$B, semantically a NameKinds.ExpandedName
* EXPANDPREFIX Length qualified_NameRef selector_NameRef -- A$B, prefix of expanded name, see NamedKinds.ExpandPrefixName
* EXPANDPREFIX Length qualified_NameRef selector_NameRef -- A\$B, prefix of expanded name, see NamedKinds.ExpandPrefixName
*
* UNIQUE Length separator_NameRef uniqid_Nat underlying_NameRef? -- Unique name A<separator><number>
* DEFAULTGETTER Length underlying_NameRef index_Nat -- DefaultGetter$<number>
*
* SUPERACCESSOR Length underlying_NameRef -- super$A
* INLINEACCESSOR Length underlying_NameRef -- inline$A
* SUPERACCESSOR Length underlying_NameRef -- super\$A
* INLINEACCESSOR Length underlying_NameRef -- inline\$A
* OBJECTCLASS Length underlying_NameRef -- A$ (name of the module class for module A)
*
* SIGNED Length original_NameRef resultSig_NameRef ParamSig* -- name + signature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ private[analyze] object FieldChecker {
if (oldfld.nonAccessible) None else {
val newflds = newclazz.lookupClassFields(oldfld)
if (newflds.hasNext) {
val newfld = newflds.next
val newfld = newflds.next()
if (!newfld.isPublic) Some(InaccessibleFieldProblem(newfld))
else if (oldfld.descriptor != newfld.descriptor) Some(IncompatibleFieldTypeProblem(oldfld, newfld))
else if (oldfld.isStatic && !newfld.isStatic) Some(StaticVirtualMemberProblem(oldfld))
Expand Down

0 comments on commit 571ed1d

Please sign in to comment.