@@ -278,20 +278,45 @@ class CompilationTests {
278
278
* compatible, but (b) and (c) are not. If (b) and (c) are compiled together, there should be
279
279
* an error when reading the files' TASTy trees. */
280
280
locally {
281
- val tastyErrorGroup = TestGroup (" checkInit/tasty-error" )
281
+ val tastyErrorGroup = TestGroup (" checkInit/tasty-error/val-or-defdef " )
282
282
val tastyErrorOptions = options.without(" -Xfatal-warnings" )
283
283
284
- val a0Dir = defaultOutputDir + tastyErrorGroup + " /A/v0/A"
285
- val a1Dir = defaultOutputDir + tastyErrorGroup + " /A/v1/A"
286
- val b1Dir = defaultOutputDir + tastyErrorGroup + " /B/v1/B"
284
+ val classA0 = defaultOutputDir + tastyErrorGroup + " /A/v0/A"
285
+ val classA1 = defaultOutputDir + tastyErrorGroup + " /A/v1/A"
286
+ val classB1 = defaultOutputDir + tastyErrorGroup + " /B/v1/B"
287
287
288
288
val tests = List (
289
- compileFile(" tests/init/tasty-error/v1/A.scala" , tastyErrorOptions)(tastyErrorGroup),
290
- compileFile(" tests/init/tasty-error/v1/B.scala" , tastyErrorOptions.withClasspath(a1Dir ))(tastyErrorGroup),
291
- compileFile(" tests/init/tasty-error/v0/A.scala" , tastyErrorOptions)(tastyErrorGroup),
289
+ compileFile(" tests/init/tasty-error/val-or-defdef/ v1/A.scala" , tastyErrorOptions)(tastyErrorGroup),
290
+ compileFile(" tests/init/tasty-error/val-or-defdef/ v1/B.scala" , tastyErrorOptions.withClasspath(classA1 ))(tastyErrorGroup),
291
+ compileFile(" tests/init/tasty-error/val-or-defdef/ v0/A.scala" , tastyErrorOptions)(tastyErrorGroup),
292
292
).map(_.keepOutput.checkCompile())
293
293
294
- compileFile(" tests/init/tasty-error/Main.scala" , tastyErrorOptions.withClasspath(a0Dir).withClasspath(b1Dir))(tastyErrorGroup).checkExpectedErrors()
294
+ compileFile(" tests/init/tasty-error/val-or-defdef/Main.scala" , tastyErrorOptions.withClasspath(classA0).withClasspath(classB1))(tastyErrorGroup).checkExpectedErrors()
295
+
296
+ tests.foreach(_.delete())
297
+ }
298
+
299
+ /* This tests for errors in the program's TASTy trees.
300
+ * The test consists of five files: Main, C, v1/A, v1/B, and v0/A. The files v1/A, v1/B, and v0/A all depend on C. v1/A and v1/B are
301
+ * compatible, but v1/B and v0/A are not. If v1/B and v0/A are compiled together, there should be
302
+ * an error when reading the files' TASTy trees. This fact is demonstrated by the compilation of Main. */
303
+ locally {
304
+ val tastyErrorGroup = TestGroup (" checkInit/tasty-error/typedef" )
305
+ val tastyErrorOptions = options.without(" -Xfatal-warnings" ).without(" -Ycheck:all" )
306
+
307
+ val classC = defaultOutputDir + tastyErrorGroup + " /C/typedef/C"
308
+ val classA0 = defaultOutputDir + tastyErrorGroup + " /A/v0/A"
309
+ val classA1 = defaultOutputDir + tastyErrorGroup + " /A/v1/A"
310
+ val classB1 = defaultOutputDir + tastyErrorGroup + " /B/v1/B"
311
+
312
+ val tests = List (
313
+ compileFile(" tests/init/tasty-error/typedef/C.scala" , tastyErrorOptions)(tastyErrorGroup),
314
+ compileFile(" tests/init/tasty-error/typedef/v1/A.scala" , tastyErrorOptions.withClasspath(classC))(tastyErrorGroup),
315
+ compileFile(" tests/init/tasty-error/typedef/v1/B.scala" , tastyErrorOptions.withClasspath(classC).withClasspath(classA1))(tastyErrorGroup),
316
+ compileFile(" tests/init/tasty-error/typedef/v0/A.scala" , tastyErrorOptions.withClasspath(classC))(tastyErrorGroup),
317
+ ).map(_.keepOutput.checkCompile())
318
+
319
+ compileFile(" tests/init/tasty-error/typedef/Main.scala" , tastyErrorOptions.withClasspath(classC).withClasspath(classA0).withClasspath(classB1))(tastyErrorGroup).checkExpectedErrors()
295
320
296
321
tests.foreach(_.delete())
297
322
}
0 commit comments