Skip to content

Commit df4da02

Browse files
committed
tweak message header
1 parent 02ec718 commit df4da02

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

compiler/test/dotty/tools/dotc/core/tasty/TastyHeaderUnpicklerTest.scala

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class TastyHeaderUnpicklerTest {
5656
val file = TastyVersion(28, 4, 1)
5757
val read = TastyVersion(28, 4, 0)
5858
expectUnpickleError(runTest(file, read, "Scala 3.4.0-RC1-bin-SNAPSHOT")) {
59-
"""TASTy file produced by Scala 3.4.0-RC1-bin-SNAPSHOT has a backward incompatible TASTy version 28.4-experimental-1,
59+
"""Backward incompatible TASTy file has version 28.4-experimental-1, produced by Scala 3.4.0-RC1-bin-SNAPSHOT,
6060
| expected stable TASTy from 28.0 to 28.4.
6161
| The source of this file should be recompiled by a Scala 3.4.0 compiler or newer.
6262
| Usually this means that the library dependency containing this file should be updated.
@@ -70,7 +70,7 @@ class TastyHeaderUnpicklerTest {
7070
val file = TastyVersion(28, 3, 1)
7171
val read = TastyVersion(28, 4, 0)
7272
expectUnpickleError(runTest(file, read, "Scala 3.2.1-RC1-bin-SNAPSHOT")) {
73-
"""TASTy file produced by Scala 3.2.1-RC1-bin-SNAPSHOT has a backward incompatible TASTy version 28.3-experimental-1,
73+
"""Backward incompatible TASTy file has version 28.3-experimental-1, produced by Scala 3.2.1-RC1-bin-SNAPSHOT,
7474
| expected stable TASTy from 28.0 to 28.4.
7575
| The source of this file should be recompiled by a Scala 3.3.0 compiler or newer.
7676
| Usually this means that the library dependency containing this file should be updated.
@@ -84,7 +84,7 @@ class TastyHeaderUnpicklerTest {
8484
val file = TastyVersion(27, 3, 0)
8585
val read = TastyVersion(28, 3, 0)
8686
expectUnpickleError(runTest(file, read, "Scala 3.0.0-M1")) {
87-
"""TASTy file has a backward incompatible TASTy version 27.3,
87+
"""Backward incompatible TASTy file has version 27.3,
8888
| expected stable TASTy from 28.0 to 28.3.
8989
| The source of this file should be recompiled by a Scala 3.0.0 compiler or newer.
9090
| Usually this means that the library dependency containing this file should be updated.
@@ -99,7 +99,7 @@ class TastyHeaderUnpicklerTest {
9999
val file = TastyVersion(27, 3, 0)
100100
val read = TastyVersion(28, 3, 0)
101101
expectUnpickleError(runTest(file, read, "Scala 3.0.0-M1", generic = true)) {
102-
"""TASTy file has a backward incompatible TASTy version 27.3,
102+
"""Backward incompatible TASTy file has version 27.3,
103103
| expected stable TASTy from 28.0 to 28.3.
104104
| The source of this file should be recompiled by a later version.
105105
| Usually this means that the classpath entry of this file should be updated.
@@ -113,7 +113,7 @@ class TastyHeaderUnpicklerTest {
113113
val file = TastyVersion(28, 4, 1)
114114
val read = TastyVersion(28, 4, 2)
115115
expectUnpickleError(runTest(file, read, "Scala 3.3.3-RC1-NIGHTLY")) {
116-
"""TASTy file produced by Scala 3.3.3-RC1-NIGHTLY has a backward incompatible TASTy version 28.4-experimental-1,
116+
"""Backward incompatible TASTy file has version 28.4-experimental-1, produced by Scala 3.3.3-RC1-NIGHTLY,
117117
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-2.
118118
| The source of this file should be recompiled by the same nightly or snapshot Scala 3.3 compiler.
119119
| Usually this means that the library dependency containing this file should be updated.
@@ -128,7 +128,7 @@ class TastyHeaderUnpicklerTest {
128128
val file = TastyVersion(28, 4, 1)
129129
val read = TastyVersion(28, 4, 2)
130130
expectUnpickleError(runTest(file, read, "Scala 3.3.3-RC1-NIGHTLY", generic = true)) {
131-
"""TASTy file produced by Scala 3.3.3-RC1-NIGHTLY has a backward incompatible TASTy version 28.4-experimental-1,
131+
"""Backward incompatible TASTy file has version 28.4-experimental-1, produced by Scala 3.3.3-RC1-NIGHTLY,
132132
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-2.
133133
| The source of this file should be recompiled by a later version.
134134
| Usually this means that the classpath entry of this file should be updated.
@@ -142,7 +142,7 @@ class TastyHeaderUnpicklerTest {
142142
val file = TastyVersion(28, 3, 0)
143143
val read = TastyVersion(28, 2, 0)
144144
expectUnpickleError(runTest(file, read, "Scala 3.3.1")) {
145-
"""TASTy file produced by Scala 3.3.1 has a forward incompatible TASTy version 28.3,
145+
"""Forward incompatible TASTy file has version 28.3, produced by Scala 3.3.1,
146146
| expected stable TASTy from 28.0 to 28.2.
147147
| To read this TASTy file, use a Scala 3.3.0 compiler or newer.
148148
| Please refer to the documentation for information on TASTy versioning:
@@ -156,7 +156,7 @@ class TastyHeaderUnpicklerTest {
156156
val file = TastyVersion(28, 3, 0)
157157
val read = TastyVersion(28, 2, 0)
158158
expectUnpickleError(runTest(file, read, "Scala 3.3.1", generic = true)) {
159-
"""TASTy file produced by Scala 3.3.1 has a forward incompatible TASTy version 28.3,
159+
"""Forward incompatible TASTy file has version 28.3, produced by Scala 3.3.1,
160160
| expected stable TASTy from 28.0 to 28.2.
161161
| To read this TASTy file, use a newer version of this tool compatible with TASTy 28.3.
162162
| Please refer to the documentation for information on TASTy versioning:
@@ -169,7 +169,7 @@ class TastyHeaderUnpicklerTest {
169169
val file = TastyVersion(28, 3, 1)
170170
val read = TastyVersion(28, 2, 0)
171171
expectUnpickleError(runTest(file, read, "Scala 3.2.2-RC1-NIGHTLY")) {
172-
"""TASTy file produced by Scala 3.2.2-RC1-NIGHTLY has a forward incompatible TASTy version 28.3-experimental-1,
172+
"""Forward incompatible TASTy file has version 28.3-experimental-1, produced by Scala 3.2.2-RC1-NIGHTLY,
173173
| expected stable TASTy from 28.0 to 28.2.
174174
| To read this experimental TASTy file, use the same nightly or snapshot Scala 3.2 compiler.
175175
| Note that you are using a stable compiler, which can not read experimental TASTy.
@@ -183,7 +183,7 @@ class TastyHeaderUnpicklerTest {
183183
val file = TastyVersion(29, 0, 0)
184184
val read = TastyVersion(28, 3, 0)
185185
expectUnpickleError(runTest(file, read, "Scala 4.0.0")) {
186-
"""TASTy file produced by Scala 4.0.0 has a forward incompatible TASTy version 29.0,
186+
"""Forward incompatible TASTy file has version 29.0, produced by Scala 4.0.0,
187187
| expected stable TASTy from 28.0 to 28.3.
188188
| To read this TASTy file, use a more recent Scala compiler.
189189
| Please refer to the documentation for information on TASTy versioning:
@@ -196,7 +196,7 @@ class TastyHeaderUnpicklerTest {
196196
val file = TastyVersion(29, 0, 1)
197197
val read = TastyVersion(28, 3, 0)
198198
expectUnpickleError(runTest(file, read, "Scala 4.0.0-M1")) {
199-
"""TASTy file produced by Scala 4.0.0-M1 has a forward incompatible TASTy version 29.0-experimental-1,
199+
"""Forward incompatible TASTy file has version 29.0-experimental-1, produced by Scala 4.0.0-M1,
200200
| expected stable TASTy from 28.0 to 28.3.
201201
| To read this experimental TASTy file, use the same Scala compiler.
202202
| Note that you are using a stable compiler, which can not read experimental TASTy.
@@ -211,7 +211,7 @@ class TastyHeaderUnpicklerTest {
211211
val file = TastyVersion(29, 0, 1)
212212
val read = TastyVersion(28, 3, 0)
213213
expectUnpickleError(runTest(file, read, "Scala 4.0.0-M1", generic = true)) {
214-
"""TASTy file produced by Scala 4.0.0-M1 has a forward incompatible TASTy version 29.0-experimental-1,
214+
"""Forward incompatible TASTy file has version 29.0-experimental-1, produced by Scala 4.0.0-M1,
215215
| expected stable TASTy from 28.0 to 28.3.
216216
| To read this experimental TASTy file, use the version of this tool compatible with TASTy 29.0-experimental-1.
217217
| Note that this tool does not support reading experimental TASTy.
@@ -225,7 +225,7 @@ class TastyHeaderUnpicklerTest {
225225
val file = TastyVersion(28, 4, 0)
226226
val read = TastyVersion(28, 4, 1) // 3.4.0-RC1-NIGHTLY
227227
expectUnpickleError(runTest(file, read, "Scala 3.4.2")) {
228-
"""TASTy file produced by Scala 3.4.2 has a forward incompatible TASTy version 28.4,
228+
"""Forward incompatible TASTy file has version 28.4, produced by Scala 3.4.2,
229229
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-1.
230230
| To read this TASTy file, use a Scala 3.4.0 compiler or newer.
231231
| Please refer to the documentation for information on TASTy versioning:
@@ -238,7 +238,7 @@ class TastyHeaderUnpicklerTest {
238238
val file = TastyVersion(28, 4, 2)
239239
val read = TastyVersion(28, 4, 1)
240240
expectUnpickleError(runTest(file, read, "Scala 3.3.3-RC2-NIGHTLY")) {
241-
"""TASTy file produced by Scala 3.3.3-RC2-NIGHTLY has a forward incompatible TASTy version 28.4-experimental-2,
241+
"""Forward incompatible TASTy file has version 28.4-experimental-2, produced by Scala 3.3.3-RC2-NIGHTLY,
242242
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-1.
243243
| To read this experimental TASTy file, use the same nightly or snapshot Scala 3.3 compiler.
244244
| Please refer to the documentation for information on TASTy versioning:
@@ -252,7 +252,7 @@ class TastyHeaderUnpicklerTest {
252252
val file = TastyVersion(28, 4, 2)
253253
val read = TastyVersion(28, 4, 1)
254254
expectUnpickleError(runTest(file, read, "Scala 3.3.3-RC2-NIGHTLY", generic = true)) {
255-
"""TASTy file produced by Scala 3.3.3-RC2-NIGHTLY has a forward incompatible TASTy version 28.4-experimental-2,
255+
"""Forward incompatible TASTy file has version 28.4-experimental-2, produced by Scala 3.3.3-RC2-NIGHTLY,
256256
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-1.
257257
| To read this experimental TASTy file, use the version of this tool compatible with TASTy 28.4-experimental-2.
258258
| Please refer to the documentation for information on TASTy versioning:

tasty/src/dotty/tools/tasty/TastyHeaderUnpickler.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class TastyHeaderUnpickler(config: UnpicklerConfig, reader: TastyReader) {
103103
val fileMinor = readNat()
104104
val fileVersion = TastyVersion(fileMajor, fileMinor, 0)
105105
val toolVersion = TastyVersion(toolMajor, toolMinor, toolExperimental)
106-
val signature = signatureString(fileVersion, toolVersion, what = "backward", tool = None)
106+
val signature = signatureString(fileVersion, toolVersion, what = "Backward", tool = None)
107107
val fix = recompileFix(toolVersion.minStable)
108108
throw new UnpickleException(signature + fix + tastyAddendum)
109109
}
@@ -141,7 +141,7 @@ class TastyHeaderUnpickler(config: UnpicklerConfig, reader: TastyReader) {
141141

142142
val compat = Compatibility.failReason(file = fileVersion, read = toolVersion)
143143

144-
val what = if (compat < 0) "backward" else "forward"
144+
val what = if (compat < 0) "Backward" else "Forward"
145145
val signature = signatureString(fileVersion, toolVersion, what, tool = Some(toolingVersion))
146146
val fix = (
147147
if (compat < 0) {
@@ -169,8 +169,8 @@ class TastyHeaderUnpickler(config: UnpicklerConfig, reader: TastyReader) {
169169

170170
private def signatureString(
171171
fileVersion: TastyVersion, toolVersion: TastyVersion, what: String, tool: Option[String]) = {
172-
val optProducedBy = tool.fold("")(t => s" produced by $t")
173-
s"""TASTy file$optProducedBy has a $what incompatible TASTy version ${fileVersion.show},
172+
val optProducedBy = tool.fold("")(t => s", produced by $t")
173+
s"""$what incompatible TASTy file has version ${fileVersion.show}$optProducedBy,
174174
| expected ${toolVersion.validRange}.
175175
|""".stripMargin
176176
}

0 commit comments

Comments
 (0)