Skip to content
Draft
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
2 changes: 1 addition & 1 deletion bin/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version=$1
scala212=2.12.20
scala213=2.13.16
scala3LTS=3.3.6
scala3Next=3.7.3
scala3Next=3.7.4-RC1

cs resolve \
ch.epfl.scala:scalafix-interfaces:$version \
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object Dependencies {
val scala33 = "3.3.6"
val scala35 = "3.5.2"
val scala36 = "3.6.4"
val scala37 = "3.7.3"
val scala37 = "3.7.4-RC1"
val scala3LTS = scala33
val scala3Next = sys.props.getOrElse("scala3.nightly", scala37)

Expand Down
145 changes: 145 additions & 0 deletions scalafix-tests/integration/src/main/resources-3.7/expect/Pretty.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
[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:10]: List.apply[Int](*)
[8:3..8:3]: test/PrettyTest#`<init>`(). => primary ctor <init>(): PrettyTest
[10:10..10:11]: intWrapper(*)
[11:10..11:11]: intWrapper(*)
[15:10..15:16]: *.apply[Inclusive]
[15:10..15:26]: Future.apply[Inclusive](*)
[15:10..15:26]: *(global)
[15:17..15:18]: intWrapper(*)
[16:10..16:16]: *.apply[Inclusive]
[16:10..16:32]: Future.apply[Inclusive](*)
[16:10..16:32]: *(global)
[16:17..16:18]: intWrapper(*)
[21:3..21:3]: test/PrettyTest#Inner#`<init>`(). => primary ctor <init>(): 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
}]
[25:3..28:6]: Option.apply[Object {
local6 => abstract method foo(a: Int): Int
local7 => abstract method bar(a: Int): Int
}](*)
[29:3..29:12]: Option.apply[a.Inner](*)
[30:3..30:9]: *.apply[Int & String]
[30:3..30:45]: Option.apply[Int & String](*)
[31:3..31:39]: Option.apply[PrettyTest](*)
[38:7..38:10]: test/ann# => class ann[T] extends Annotation with StaticAnnotation { self: ann[T] => +3 decls }
[38:10..38:10]: test/ann#`<init>`(). => primary ctor <init>[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#`<init>`(). => primary ctor <init>(): ann1
[40:7..40:11]: test/ann2# => class ann2 extends Annotation with StaticAnnotation { self: ann2 => +1 decls }
[40:20..40:20]: test/ann2#`<init>`(). => primary ctor <init>(): ann2
[42:1..42:1]: test/B#`<init>`(). => primary ctor <init>(): B
[42:7..42:8]: test/B# => class B extends Object { self: B => +1 decls }
[44:1..44:1]: test/C#`<init>`(). => primary ctor <init>(): 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#`<init>`(). => primary ctor <init>(): C
[47:3..47:3]: test/P#`<init>`(). => primary ctor <init>(): P
[47:9..47:10]: test/P#C# => class C extends Object { self: C => +1 decls }
[48:3..48:3]: test/P#X#`<init>`(). => primary ctor <init>(): 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#`<init>`(). => primary ctor <init>(): C
[53:3..53:3]: test/T#`<init>`(). => primary ctor <init>(): T
[53:9..53:10]: test/T#C# => class C extends Object { self: C => +1 decls }
[54:3..54:3]: test/T#X#`<init>`(). => primary ctor <init>(): 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#`<init>`(). => primary ctor <init>(): 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#`<init>`(). => primary ctor <init>(): 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#`<init>`(). => primary ctor <init>(): 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#`<init>`(). => primary ctor <init>(): 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#`<init>`(). => primary ctor <init>[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#`<init>`(). => primary ctor <init>(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
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,27 @@ trait ExpectSuite extends AnyFunSuite with DiffAssertions {
def obtained(): String

final def path: AbsolutePath = {
val scalaMajorVersion = BuildInfo.scalaVersion.split("\\.")(0)
AbsolutePath(s"${BuildInfo.resourceDirectory}-${scalaMajorVersion}")
.resolve("expect")
.resolve(filename.stripSuffix("Test.scala") + ".expect")
val versionParts = BuildInfo.scalaVersion.split("\\.")
val scalaMajorVersion = versionParts(0)
val scalaMinorVersion = versionParts(1)
val scalaMajorMinorVersion = s"${scalaMajorVersion}.${scalaMinorVersion}"

val expectFileName = filename.stripSuffix("Test.scala") + ".expect"

// Try minor version specific directory first (e.g., resources-3.7)
val minorVersionPath =
AbsolutePath(s"${BuildInfo.resourceDirectory}-${scalaMajorMinorVersion}")
.resolve("expect")
.resolve(expectFileName)

if (minorVersionPath.toFile.exists()) {
minorVersionPath
} else {
// Fall back to major version directory (e.g., resources-3)
AbsolutePath(s"${BuildInfo.resourceDirectory}-${scalaMajorVersion}")
.resolve("expect")
.resolve(expectFileName)
}
}
final implicit lazy val sdoc: SemanticDocument =
BaseSemanticSuite.loadDoc(filename)
Expand Down