diff --git a/bin/test-release.sh b/bin/test-release.sh index fe89a5186..af51c73d4 100755 --- a/bin/test-release.sh +++ b/bin/test-release.sh @@ -6,7 +6,7 @@ version=$1 scala212=2.12.20 scala213=2.13.17 scala3LTS=3.3.7 -scala3Next=3.7.3 +scala3Next=3.7.4 cs resolve \ ch.epfl.scala:scalafix-interfaces:$version \ diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 11498e8d2..d2e0be606 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -11,7 +11,7 @@ object Dependencies { val scala33 = "3.3.7" val scala35 = "3.5.2" val scala36 = "3.6.4" - val scala37 = "3.7.3" + val scala37 = "3.7.4" val scala3LTS = scala33 val scala3Next = sys.props.getOrElse("scala3.nightly", scala37) diff --git a/project/ScalafixBuild.scala b/project/ScalafixBuild.scala index 1b94b9378..01742c484 100644 --- a/project/ScalafixBuild.scala +++ b/project/ScalafixBuild.scala @@ -241,6 +241,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys { ) private val PreviousScalaVersion: Map[String, Option[String]] = Map( + scala37 -> Some("3.7.3") ) override def buildSettings: Seq[Setting[_]] = List( diff --git a/scalafix-tests/integration/src/main/resources-3.7/expect/Pretty.expect b/scalafix-tests/integration/src/main/resources-3.7/expect/Pretty.expect deleted file mode 100644 index 06c00c3f8..000000000 --- a/scalafix-tests/integration/src/main/resources-3.7/expect/Pretty.expect +++ /dev/null @@ -1,135 +0,0 @@ -[7:7..7:17]: test/PrettyTest# => class PrettyTest extends Object { self: PrettyTest => +6 decls } -[8:3..8:14]: *[Int] -[8:3..8:7]: *.apply[Int] -[8:3..8:3]: test/PrettyTest#``(). => primary ctor (): PrettyTest -[10:10..10:11]: intWrapper(*) -[11:10..11:11]: intWrapper(*) -[15:10..15:16]: *.apply[Inclusive] -[15:10..15:26]: *(global) -[15:17..15:18]: intWrapper(*) -[16:10..16:16]: *.apply[Inclusive] -[16:10..16:32]: *(global) -[16:17..16:18]: intWrapper(*) -[21:3..21:3]: test/PrettyTest#Inner#``(). => primary ctor (): Inner -[21:9..21:14]: test/PrettyTest#Inner# => class Inner extends Object { self: Inner => +1 decls } -[22:7..22:8]: test/PrettyTest#a. => val method aPrettyTest -[23:7..23:8]: test/PrettyTest#b. => val method ba.Inner -[25:3..25:9]: *.apply[Object { - local4 => abstract method foo(a: Int): Int - local5 => abstract method bar(a: Int): Int - }] -[30:3..30:9]: *.apply[Int & String] -[38:7..38:10]: test/ann# => class ann[T] extends Annotation with StaticAnnotation { self: ann[T] => +3 decls } -[38:10..38:10]: test/ann#``(). => primary ctor [T](x: T): ann[T] -[38:11..38:12]: test/ann#[T] => typeparam T -[38:14..38:15]: test/ann#x. => private[this] val method xT -[39:7..39:11]: test/ann1# => class ann1 extends Annotation with StaticAnnotation { self: ann1 => +1 decls } -[39:20..39:20]: test/ann1#``(). => primary ctor (): ann1 -[40:7..40:11]: test/ann2# => class ann2 extends Annotation with StaticAnnotation { self: ann2 => +1 decls } -[40:20..40:20]: test/ann2#``(). => primary ctor (): ann2 -[42:1..42:1]: test/B#``(). => primary ctor (): B -[42:7..42:8]: test/B# => class B extends Object { self: B => +1 decls } -[44:1..44:1]: test/C#``(). => primary ctor (): C -[44:7..44:8]: test/C# => class C extends Object { self: C => +1 decls } -[46:7..46:8]: test/P# => class P extends Object { self: P => +8 decls } -[47:3..47:3]: test/P#C#``(). => primary ctor (): C -[47:3..47:3]: test/P#``(). => primary ctor (): P -[47:9..47:10]: test/P#C# => class C extends Object { self: C => +1 decls } -[48:3..48:3]: test/P#X#``(). => primary ctor (): X -[48:9..48:10]: test/P#X# => class X extends Object { self: X => +1 decls } -[49:7..49:8]: test/P#x. => val method xX -[52:7..52:8]: test/T# => class T extends Object { self: T => +8 decls } -[53:3..53:3]: test/T#C#``(). => primary ctor (): C -[53:3..53:3]: test/T#``(). => primary ctor (): T -[53:9..53:10]: test/T#C# => class C extends Object { self: C => +1 decls } -[54:3..54:3]: test/T#X#``(). => primary ctor (): X -[54:9..54:10]: test/T#X# => class X extends Object { self: X => +1 decls } -[55:7..55:8]: test/T#x. => val method xX -[58:8..58:12]: test/Test. => final object Test extends Object { self: Test.type => +12 decls } -[59:9..59:10]: test/Test.M# => class M extends Object { self: M => +2 decls } -[60:5..60:5]: test/Test.M#``(). => primary ctor (): M -[60:9..60:10]: test/Test.M#m(). => method m=> Int -[63:9..63:10]: test/Test.N# => trait N extends Object { self: N => +2 decls } -[64:5..64:5]: test/Test.N#``(). => primary ctor (): N -[64:9..64:10]: test/Test.N#n(). => method n=> Int -[67:9..67:10]: test/Test.C# => class C extends M { self: C => +42 decls } -[67:19..67:19]: test/Test.C#``(). => primary ctor (): C -[68:9..68:10]: test/Test.C#p. => val method pP -[69:9..69:10]: test/Test.C#x. => val method xp.X -[71:9..71:17]: test/Test.C#typeRef1. => val method typeRef1C -[72:9..72:17]: test/Test.C#typeRef2. => val method typeRef2p.C -[73:9..73:17]: test/Test.C#typeRef3. => val method typeRef3T#C -[74:9..74:17]: test/Test.C#typeRef4. => val method typeRef4List[Int] -[76:9..76:20]: test/Test.C#singleType1. => val method singleType1x.type -[77:9..77:20]: test/Test.C#singleType2. => val method singleType2p.x.type -[78:9..78:15]: test/Test.C#Either. => val method EitherEither.type -[80:9..80:18]: test/Test.C#thisType1. => val method thisType1C.this.type -[81:9..81:18]: test/Test.C#thisType2. => val method thisType2C.this.type -[83:9..83:19]: test/Test.C#superType1. => val method superType1Int -[84:9..84:19]: test/Test.C#superType2. => val method superType2Int -[85:9..85:19]: test/Test.C#superType3. => val method superType3Int -[87:9..87:22]: test/Test.C#compoundType1. => val method compoundType1Object { def k=> Int } -[88:9..88:22]: test/Test.C#compoundType2. => val method compoundType2M & N -[89:9..89:22]: test/Test.C#compoundType3. => val method compoundType3M & N { def k=> Int } -[90:9..90:22]: test/Test.C#compoundType4. => val method compoundType4Object -[91:9..91:22]: test/Test.C#compoundType5. => val method compoundType5M & N -[92:9..92:22]: test/Test.C#compoundType6. => val method compoundType6M & N -[94:9..94:17]: test/Test.C#annType1. => val method annType1T @ann[T] -[94:21..94:25]: [Int] -[95:9..95:17]: test/Test.C#annType2. => val method annType2T @ann1 @ann2 -[97:9..97:25]: test/Test.C#existentialType2. => val method existentialType2List[_] forSome { type _ } -[98:9..98:25]: test/Test.C#existentialType3. => val method existentialType3Class[_] forSome { type _ } -[99:9..99:25]: test/Test.C#existentialType4. => val method existentialType4Class[_] forSome { type _ } -[101:9..101:20]: test/Test.C#typeLambda1(). => method typeLambda1[M[type _]]: Nothing -[101:21..101:22]: test/Test.C#typeLambda1().[M] => typeparam M[type _] -[104:12..104:26]: test/Test.C#ClassInfoType1. => final object ClassInfoType1 extends Object { self: ClassInfoType1.type => +1 decls } -[105:11..105:25]: test/Test.C#ClassInfoType2# => class ClassInfoType2 extends B { self: ClassInfoType2 => +2 decls } -[105:34..105:34]: test/Test.C#ClassInfoType2#``(). => primary ctor (): ClassInfoType2 -[105:42..105:43]: test/Test.C#ClassInfoType2#x(). => method x=> Int -[106:11..106:25]: test/Test.C#ClassInfoType3# => trait ClassInfoType3[T] extends Object { self: ClassInfoType3[T] => +2 decls } -[106:25..106:25]: test/Test.C#ClassInfoType3#``(). => primary ctor [T](): ClassInfoType3[T] -[106:26..106:27]: test/Test.C#ClassInfoType3#[T] => typeparam T -[108:12..108:22]: test/Test.C#MethodType. => final object MethodType extends Object { self: MethodType.type => +7 decls } -[109:11..109:13]: test/Test.C#MethodType.x1(). => method x1=> Int -[110:11..110:13]: test/Test.C#MethodType.x2(). => method x2=> Int -[111:11..111:13]: test/Test.C#MethodType.m3(). => method m3=> Int -[112:11..112:13]: test/Test.C#MethodType.m4(). => method m4(): Int -[113:11..113:13]: test/Test.C#MethodType.m5(). => method m5(x: Int): Int -[113:14..113:15]: test/Test.C#MethodType.m5().(x) => param x: Int -[114:11..114:13]: test/Test.C#MethodType.m6(). => method m6[T](x: T): T -[114:14..114:15]: test/Test.C#MethodType.m6().[T] => typeparam T -[114:17..114:18]: test/Test.C#MethodType.m6().(x) => param x: T -[117:12..117:22]: test/Test.C#ByNameType. => final object ByNameType extends Object { self: ByNameType.type => +2 decls } -[118:11..118:13]: test/Test.C#ByNameType.m1(). => method m1(x: => Int): Int -[118:14..118:15]: test/Test.C#ByNameType.m1().(x) => param x: => Int -[121:16..121:28]: test/Test.C#RepeatedType# => case class RepeatedType extends Object with Product with Serializable { self: RepeatedType => +4 decls } -[121:28..121:28]: test/Test.C#RepeatedType#``(). => primary ctor (val s: String*): RepeatedType -[121:29..121:30]: test/Test.C#RepeatedType#s. => val method sString* -[122:11..122:13]: test/Test.C#RepeatedType#m1(). => method m1(x: Int*): Int -[122:14..122:15]: test/Test.C#RepeatedType#m1().(x) => param x: Int* -[125:12..125:20]: test/Test.C#TypeType. => final object TypeType extends Object { self: TypeType.type => +6 decls } -[126:12..126:14]: test/Test.C#TypeType.T1# => type T1 -[127:11..127:13]: test/Test.C#TypeType.m2(). => method m2[T2 = C]: Nothing -[127:14..127:16]: test/Test.C#TypeType.m2().[T2] => typeparam T2 = C -[128:11..128:13]: test/Test.C#TypeType.m3(). => method m3[M3[type _]]: Nothing -[128:14..128:16]: test/Test.C#TypeType.m3().[M3] => typeparam M3[type _] -[129:12..129:14]: test/Test.C#TypeType.T4# => type T4 = C -[130:12..130:14]: test/Test.C#TypeType.T5# => type T5[U] = U -[130:15..130:16]: test/Test.C#TypeType.T5#[U] => typeparam U -[134:10..134:17]: test/Test.Literal. => final object Literal extends Object { self: Literal.type => +12 decls } -[135:15..135:18]: test/Test.Literal.int. => final val method int1 -[136:15..136:19]: test/Test.Literal.long. => final val method long1L -[137:15..137:20]: test/Test.Literal.float. => final val method float1.0f -[138:15..138:21]: test/Test.Literal.double. => final val method double2.0 -[139:15..139:18]: test/Test.Literal.nil. => final val method nilNull -[140:15..140:19]: test/Test.Literal.char. => final val method char'a' -[141:15..141:21]: test/Test.Literal.string. => final val method string"a" -[142:15..142:19]: test/Test.Literal.bool. => final val method booltrue -[143:15..143:19]: test/Test.Literal.unit. => final val method unitUnit -[144:15..144:23]: test/Test.Literal.javaEnum. => final val method javaEnumLinkOption -[145:15..145:22]: test/Test.Literal.clazzOf. => final val method clazzOfOption[Int] -[148:8..148:13]: test/Test.MapKV# => type MapKV[K] = [V] =>> Map[K, V] -[148:17..148:18]: test/Test.MapKV#[K] => typeparam K -[148:25..148:26]: test/Test.MapKV#[V] => typeparam V -[150:8..150:15]: test/Test.Convert# => type Convert[X] = X match { String => Char, Int => Float } -[150:16..150:17]: test/Test.Convert#[X] => typeparam X \ No newline at end of file diff --git a/scalafix-tests/integration/src/main/resources-3.3/expect/Pretty.expect b/scalafix-tests/integration/src/main/resources-3/expect/Pretty.expect similarity index 100% rename from scalafix-tests/integration/src/main/resources-3.3/expect/Pretty.expect rename to scalafix-tests/integration/src/main/resources-3/expect/Pretty.expect diff --git a/scalafix-tests/integration/src/test/scala/scalafix/tests/util/ExpectSuite.scala b/scalafix-tests/integration/src/test/scala/scalafix/tests/util/ExpectSuite.scala index dc065741c..af4407860 100644 --- a/scalafix-tests/integration/src/test/scala/scalafix/tests/util/ExpectSuite.scala +++ b/scalafix-tests/integration/src/test/scala/scalafix/tests/util/ExpectSuite.scala @@ -15,11 +15,18 @@ trait ExpectSuite extends AnyFunSuite with DiffAssertions { def obtained(): String final def path: AbsolutePath = { - val scalaMajorMinorVersion = - BuildInfo.scalaVersion.split('.').take(2).mkString(".") - AbsolutePath(s"${BuildInfo.resourceDirectory}-${scalaMajorMinorVersion}") - .resolve("expect") - .resolve(filename.stripSuffix("Test.scala") + ".expect") + def expectedPath(suffix: String) = + AbsolutePath(s"${BuildInfo.resourceDirectory}-${suffix}") + .resolve("expect") + .resolve(filename.stripSuffix("Test.scala") + ".expect") + + val versionPrefixesLongestFirst = + BuildInfo.scalaVersion.split("\\.").inits.map(_.mkString(".")) + + versionPrefixesLongestFirst + .map(expectedPath) + .find(_.toFile.exists()) + .get } final implicit lazy val sdoc: SemanticDocument = BaseSemanticSuite.loadDoc(filename)