Skip to content

Commit c16d2d1

Browse files
authored
Merge pull request #2912 from Gedochao/update/scala-next-rc-3.5.0-RC1
Update Scala Next RC to 3.5.0-RC1
2 parents 3132af2 + 520399a commit c16d2d1

File tree

9 files changed

+117
-73
lines changed

9 files changed

+117
-73
lines changed

modules/integration/src/test/scala/scala/cli/integration/CompileTestDefinitions.scala

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -697,15 +697,4 @@ abstract class CompileTestDefinitions
697697
expect(out.contains("Too small maximum heap"))
698698
}
699699
}
700-
701-
test(s"TASTY processor does not warn about Scala $actualScalaVersion") {
702-
TestInputs(os.rel / "simple.sc" -> s"""println("Hello")""")
703-
.fromRoot { root =>
704-
val result =
705-
os.proc(TestUtil.cli, "compile", ".", extraOptions)
706-
.call(cwd = root, stderr = os.Pipe)
707-
expect(result.exitCode == 0)
708-
expect(!result.err.text().contains("cannot post process TASTY files"))
709-
}
710-
}
711700
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
package scala.cli.integration
22

3-
class CompileTests3Lts extends CompileTestDefinitions with Test3Lts
3+
class CompileTests3Lts extends CompileTestDefinitions with CompileTests3StableDefinitions
4+
with Test3Lts
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package scala.cli.integration
2+
3+
import com.eed3si9n.expecty.Expecty.expect
4+
5+
import java.io.File
6+
7+
trait CompileTests3StableDefinitions { _: CompileTestDefinitions =>
8+
test(s"TASTY processor does not warn about Scala $actualScalaVersion") {
9+
TestInputs(os.rel / "simple.sc" -> s"""println("Hello")""")
10+
.fromRoot { root =>
11+
val result =
12+
os.proc(TestUtil.cli, "compile", ".", extraOptions)
13+
.call(cwd = root, stderr = os.Pipe)
14+
expect(result.exitCode == 0)
15+
expect(!result.err.text().contains("cannot post process TASTY files"))
16+
}
17+
}
18+
19+
test("render explain message") {
20+
val fileName = "Hello.scala"
21+
val inputs = TestInputs(
22+
os.rel / fileName -> // should be dump to 3.3.1 after release
23+
s"""//> using scala "3.3.1-RC1-bin-20230203-3ef1e73-NIGHTLY"
24+
|//> using options "--explain"
25+
|
26+
|class A
27+
|val i: Int = A()
28+
|""".stripMargin
29+
)
30+
inputs.fromRoot { root =>
31+
val out = os.proc(TestUtil.cli, "compile", extraOptions, fileName)
32+
.call(cwd = root, check = false, mergeErrIntoOut = true).out.trim()
33+
34+
expect(out.contains("Explanation"))
35+
}
36+
}
37+
38+
test("as jar") {
39+
val inputs = TestInputs(
40+
os.rel / "Foo.scala" ->
41+
"""object Foo {
42+
| def n = 2
43+
|}
44+
|""".stripMargin
45+
)
46+
inputs.fromRoot { root =>
47+
val out = os.proc(TestUtil.cli, "compile", extraOptions, ".", "--print-class-path")
48+
.call(cwd = root)
49+
.out.trim()
50+
val cp = out.split(File.pathSeparator).toVector.map(os.Path(_, root))
51+
expect(cp.headOption.exists(os.isDir(_)))
52+
expect(cp.drop(1).forall(os.isFile(_)))
53+
54+
val asJarOut = os.proc(
55+
TestUtil.cli,
56+
"--power",
57+
"compile",
58+
extraOptions,
59+
".",
60+
"--print-class-path",
61+
"--as-jar"
62+
)
63+
.call(cwd = root)
64+
.out.trim()
65+
val asJarCp = asJarOut.split(File.pathSeparator).toVector.map(os.Path(_, root))
66+
expect(asJarCp.forall(os.isFile(_)))
67+
}
68+
}
69+
70+
}
Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,4 @@
11
package scala.cli.integration
22

3-
import com.eed3si9n.expecty.Expecty.expect
4-
5-
import java.io.File
6-
7-
class CompileTestsDefault extends CompileTestDefinitions with TestDefault {
8-
test("render explain message") {
9-
val fileName = "Hello.scala"
10-
val inputs = TestInputs(
11-
os.rel / fileName -> // should be dump to 3.3.1 after release
12-
s"""//> using scala "3.3.1-RC1-bin-20230203-3ef1e73-NIGHTLY"
13-
|//> using options "--explain"
14-
|
15-
|class A
16-
|val i: Int = A()
17-
|""".stripMargin
18-
)
19-
inputs.fromRoot { root =>
20-
val out = os.proc(TestUtil.cli, "compile", extraOptions, fileName)
21-
.call(cwd = root, check = false, mergeErrIntoOut = true).out.trim()
22-
23-
expect(out.contains("Explanation"))
24-
}
25-
}
26-
27-
test("as jar") {
28-
val inputs = TestInputs(
29-
os.rel / "Foo.scala" ->
30-
"""object Foo {
31-
| def n = 2
32-
|}
33-
|""".stripMargin
34-
)
35-
inputs.fromRoot { root =>
36-
val out = os.proc(TestUtil.cli, "compile", extraOptions, ".", "--print-class-path")
37-
.call(cwd = root)
38-
.out.trim()
39-
val cp = out.split(File.pathSeparator).toVector.map(os.Path(_, root))
40-
expect(cp.headOption.exists(os.isDir(_)))
41-
expect(cp.drop(1).forall(os.isFile(_)))
42-
43-
val asJarOut = os.proc(
44-
TestUtil.cli,
45-
"--power",
46-
"compile",
47-
extraOptions,
48-
".",
49-
"--print-class-path",
50-
"--as-jar"
51-
)
52-
.call(cwd = root)
53-
.out.trim()
54-
val asJarCp = asJarOut.split(File.pathSeparator).toVector.map(os.Path(_, root))
55-
expect(asJarCp.forall(os.isFile(_)))
56-
}
57-
}
58-
}
3+
class CompileTestsDefault extends CompileTestDefinitions with CompileTests3StableDefinitions
4+
with TestDefault

modules/integration/src/test/scala/scala/cli/integration/DocTestDefinitions.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ abstract class DocTestDefinitions extends ScalaCliSuite with TestScalaVersionArg
3737
"lib/Messages$.html",
3838
"simple$.html"
3939
)
40+
else if (
41+
actualScalaVersion.coursierVersion >= "3.5.0".coursierVersion ||
42+
actualScalaVersion.startsWith("3.5")
43+
)
44+
Seq(
45+
"index.html",
46+
"inkuire-db.json",
47+
"$lessempty$greater$/simple$_.html",
48+
"lib/Messages$.html"
49+
)
4050
else
4151
Seq(
4252
"index.html",

modules/integration/src/test/scala/scala/cli/integration/PackageTestDefinitions.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,16 @@ abstract class PackageTestDefinitions extends ScalaCliSuite with TestScalaVersio
854854
"lib/Messages$.html",
855855
"simple$.html"
856856
)
857+
else if (
858+
actualScalaVersion.coursierVersion >= "3.5.0".coursierVersion ||
859+
actualScalaVersion.startsWith("3.5")
860+
)
861+
Seq(
862+
"index.html",
863+
"inkuire-db.json",
864+
"$lessempty$greater$/simple$_.html",
865+
"lib/Messages$.html"
866+
)
857867
else
858868
Seq(
859869
"index.html",

modules/integration/src/test/scala/scala/cli/integration/RunScriptTestDefinitions.scala

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,11 +601,29 @@ trait RunScriptTestDefinitions { _: RunTestDefinitions =>
601601
test(s"$wrapperType script wrapper satisfies strict compiler flags") {
602602
val expectedMessage = "Hello"
603603
val sourceFileName = "strictClassWrapper.sc"
604+
val versionDependentOpts =
605+
if (
606+
actualScalaVersion.coursierVersion >= "3.5.0".coursierVersion
607+
|| actualScalaVersion.startsWith("3.5")
608+
)
609+
Seq("-Wsafe-init")
610+
else Seq("-Yno-experimental", "-Ysafe-init")
611+
val compilerOpts = Seq(
612+
"-Werror",
613+
"-Wnonunit-statement",
614+
"-Wunused:all",
615+
"-Wvalue-discard",
616+
"-deprecation",
617+
"-feature",
618+
"-language:strictEquality",
619+
"-new-syntax",
620+
"-old-syntax",
621+
"-unchecked",
622+
"-no-indent"
623+
) ++ versionDependentOpts
604624
TestInputs(
605625
os.rel / sourceFileName ->
606-
s"""//> using options -Werror -Wnonunit-statement -Wunused:all -Wvalue-discard
607-
|//> using options -Yno-experimental -Ysafe-init -deprecation -feature -language:strictEquality
608-
|//> using options -new-syntax -old-syntax -unchecked -no-indent
626+
s"""//> using options ${compilerOpts.mkString(" ")}
609627
|
610628
|println("$expectedMessage")
611629
|""".stripMargin

modules/integration/src/test/scala/scala/cli/integration/util/CompilerPluginUtil.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ object CompilerPluginUtil {
7272
| val name: String = "$pluginName"
7373
| override val description: String = "checks for division by zero"
7474
|
75-
| def init(options: List[String]): List[PluginPhase] =
75+
| override def init(options: List[String]): List[PluginPhase] =
7676
| (new DivideZeroPhase) :: Nil
7777
|
7878
|class DivideZeroPhase extends PluginPhase:

project/deps.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ object Scala {
77
def scala3LtsPrefix = "3.3" // used for the LTS version tags
88
def scala3Lts = s"$scala3LtsPrefix.3" // the LTS version currently used in the build
99
def scala3Next = "3.4.2" // the newest/next version of Scala
10-
def scala3NextRc = "3.4.2-RC1" // the latest RC version of Scala Next
10+
def scala3NextRc = "3.5.0-RC1" // the latest RC version of Scala Next
1111

1212
// The Scala version used to build the CLI itself.
1313
def defaultInternal = sys.props.get("scala.version.internal").getOrElse(scala3Lts)

0 commit comments

Comments
 (0)