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.

0 commit comments

Comments
 (0)