Skip to content

Commit 78adb39

Browse files
committed
Third batch of neg -> warn test changes
1 parent d7fdaf3 commit 78adb39

28 files changed

+69
-339
lines changed

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ class CompilationTests {
216216
@Test def checkInitGlobal: Unit = {
217217
implicit val testGroup: TestGroup = TestGroup("checkInitGlobal")
218218
val options = defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings")
219+
compileFilesInDir("tests/init-global/neg", options).checkExpectedErrors()
220+
compileFilesInDir("tests/init-global/pos", options).checkCompile()
219221
compileFilesInDir("tests/init-global/neg", options, FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyBlacklisted)).checkExpectedErrors()
222+
compileFilesInDir("tests/init-global/warn", defaultOptions.and("-Ysafe-init-global"), FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyBlacklisted)).checkWarnings()
220223
compileFilesInDir("tests/init-global/pos", options, FileFilter.exclude(TestSources.posInitGlobalScala2LibraryTastyBlacklisted)).checkCompile()
221224
}
222225

tests/init-global/neg/i18628.scala renamed to tests/init-global/warn/i18628.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ object Test:
22
class Box(val x: Int)
33

44
def recur(a: => Box, b: => Box): Int =
5-
a.x + recur(a, b) + b.x // error // error
5+
a.x + recur(a, b) + b.x // warn // warn
66

77
recur(Box(1), Box(2))

tests/init-global/neg/i18628_2.scala renamed to tests/init-global/warn/i18628_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ object Test:
22
class Box(val x: Int)
33

44
def recur(a: => Box, b: Box): Int =
5-
a.x + recur(a, b) + b.x // error
5+
a.x + recur(a, b) + b.x // warn
66

77
recur(Box(1), Box(2))

tests/init-global/neg/i18628_3.scala renamed to tests/init-global/warn/i18628_3.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ object Test:
44
class Box(val x: Int)
55

66
def recur(a: => Box, b: => Box): Int =
7-
a.x + recur(a: @widen(5), b: @widen(5)) + b.x // error // error
7+
a.x + recur(a: @widen(5), b: @widen(5)) + b.x // warn // warn
88

99
recur(Box(1), Box(2))
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
-- Error: tests/neg-custom-args/sourcepath2/hi/A.scala:3:6 -------------------------------------------------------------
2-
3 |class Hello { // error
1+
-- Warning: tests/neg-custom-args/sourcepath2/hi/A.scala:3:6 -----------------------------------------------------------
2+
3 |class Hello { // warn
33
| ^
44
| class Hello is in the wrong directory.
55
| It was declared to be in package <empty>
66
| But it is found in directory hi
7+
No warnings can be incurred under -Werror.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Missing `package hi`
22

3-
class Hello { // error
3+
class Hello { // warn
44
val x: Int = 1
55
}
6+
// nopos-error: werror

tests/neg-deep-subtype/1828.scala

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/neg-deep-subtype/3324b.scala

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/neg-deep-subtype/3324f.scala

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/neg-deep-subtype/3324g.scala

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/neg-deep-subtype/JavaSeqLiteral.scala

Lines changed: 0 additions & 31 deletions
This file was deleted.

tests/neg-deep-subtype/conditionalWarnings.scala

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/neg-deep-subtype/gadt.scala

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/neg-deep-subtype/html.scala

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/neg-deep-subtype/i3324.scala

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/neg-deep-subtype/i4297.scala

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/neg-deep-subtype/or-type-trees.scala

Lines changed: 0 additions & 40 deletions
This file was deleted.

tests/neg-deep-subtype/refined-types.scala

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/neg-deep-subtype/t2755.scala

Lines changed: 0 additions & 60 deletions
This file was deleted.

tests/neg-deep-subtype/type-lambda.scala

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/neg-macros/i9570.check

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Warning: tests/neg-macros/i9570.scala:15:21 -------------------------------------------------------------------------
2+
15 | case '{HCons(_,$t)} => // warn (in .check file)
3+
| ^
4+
| Use of `_` for lambda in quoted pattern. Use explicit lambda instead or use `$_` to match any term.
5+
No warnings can be incurred under -Werror.

tests/neg-macros/i9570.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ object Macros {
1212
private def sizeImpl(e: Expr[HList], n:Int)(using qctx:Quotes): Expr[Int] = {
1313
import quotes.reflect.*
1414
e match {
15-
case '{HCons(_,$t)} => // error if run with fatal warinings in BootstrappedOnlyCompilationTests
15+
case '{HCons(_,$t)} => // warn (in .check file)
1616
sizeImpl(t,n+1)
1717
case '{HNil} => Expr(n)
1818
}
1919
}
2020

2121
inline def size(inline expr: HList ): Int = {
2222
${sizeImpl('expr,0)}
23-
}
23+
}
2424

2525
}
2626
}
27+
28+
// nopos-error No warnings can be incurred under -Werror.

0 commit comments

Comments
 (0)