Skip to content

Commit d283ed3

Browse files
authored
Merge pull request #657 from xuwei-k/scala-3
2 parents bcfa54c + da4caf8 commit d283ed3

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
java-version: ${{ matrix.java }}
2121
- uses: coursier/cache-action@v6
22-
- run: "sbt test mimaReportBinaryIssues 'set sbtplugin/scriptedSbt := \"1.2.8\"' 'scripted sbt-mima-plugin/minimal'"
22+
- run: "sbt +test mimaReportBinaryIssues 'set sbtplugin/scriptedSbt := \"1.2.8\"' 'scripted sbt-mima-plugin/minimal'"
2323
testFunctional:
2424
needs: build
2525
strategy:

build.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ commands += Command.command("testStaging") { state =>
2626
}
2727

2828
val scala213 = "2.13.6"
29+
val scala3 = "3.0.2"
2930

3031
val root = project.in(file(".")).settings(
3132
name := "mima",
@@ -39,7 +40,7 @@ val munit = "org.scalameta" %% "munit" % "0.7.29"
3940

4041
val core = project.settings(
4142
name := "mima-core",
42-
crossScalaVersions += scala213,
43+
crossScalaVersions ++= Seq(scala213, scala3),
4344
libraryDependencies += munit % Test,
4445
testFrameworks += new TestFramework("munit.Framework"),
4546
MimaSettings.mimaSettings,

core/src/main/scala/com/typesafe/tools/mima/core/MimaUnpickler.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,12 @@ object MimaUnpickler {
279279
var idx = 0
280280
var res = 0L
281281
var b = 0L
282-
do {
282+
while({
283283
b = data(idx).toLong
284284
idx += 1
285285
res = (res << 7) + (b & 0x7f)
286-
} while ((b & 0x80) != 0L)
286+
(b & 0x80) != 0L
287+
}) ()
287288
res.toInt
288289
}
289290

core/src/main/scala/com/typesafe/tools/mima/core/PickleBuffer.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ final class PickleBuffer(val bytes: Array[Byte]) {
1212
def readLongNat(): Long = {
1313
var b = 0L
1414
var x = 0L
15-
do {
15+
while({
1616
b = readByte().toLong
1717
x = (x << 7) + (b & 0x7f)
18-
} while ((b & 0x80) != 0L)
18+
(b & 0x80) != 0L
19+
}) ()
1920
x
2021
}
2122

core/src/main/scala/com/typesafe/tools/mima/core/Signature.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class Signature(private val signature: String) {
3030
newer.isEmpty || // ignore losing signature on constructors
3131
signature.endsWith(newer.tail) // ignore losing the 1st (outer) param (.tail drops the leading '(')
3232

33-
// a method that takes no parameters and returns Object can have no signature
34-
override def toString = if (signature.isEmpty) "<missing>" else signature
33+
// a method that takes no parameters and returns Object can have no signature
34+
override def toString = if (signature.isEmpty) "<missing>" else signature
3535
}
3636

3737
object Signature {

core/src/main/scala/com/typesafe/tools/mima/core/TastyUnpickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ object TastyUnpickler {
122122
if (nextByte == SELFDEF) skipTree(readByte()) // self
123123
val classes = new ListBuffer[ClsDef]
124124
val meths = new ListBuffer[DefDef]
125-
doUntil(end)(readByte match {
125+
doUntil(end)(readByte() match {
126126
case TYPEDEF => readTypeDef() match { case clsDef: ClsDef => classes += clsDef case _ => }
127127
case DEFDEF => meths += readDefDef()
128128
case tag => skipTree(tag)
@@ -354,7 +354,7 @@ object TastyUnpickler {
354354

355355
final case class SimpleName(raw: String) extends Name
356356
final case class ObjectName(base: Name) extends Name
357-
final case class TypeName private (base: Name) extends Name
357+
final case class TypeName private[TastyUnpickler] (base: Name) extends Name
358358
final case class QualifiedName(qual: Name, sep: SimpleName, sel: SimpleName) extends Name
359359

360360
final case class UniqueName(qual: Name, sep: SimpleName, num: Int) extends Name

0 commit comments

Comments
 (0)