Skip to content

Commit 453658b

Browse files
authored
Move rest of the warn tests from neg to warn (batch 3) (#19244)
The last batch of tests, move tests other than tests/init/neg and tests/neg to warn. PR 4/5 (merge consecutively, per [Nicolas' suggestion](#18829 (review)) Split up version of #18829
2 parents a20027f + bfe0c70 commit 453658b

File tree

9 files changed

+14
-18
lines changed

9 files changed

+14
-18
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ class CompilationTests {
217217
implicit val testGroup: TestGroup = TestGroup("checkInitGlobal")
218218
val options = defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings")
219219
compileFilesInDir("tests/init-global/neg", options, FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyBlacklisted)).checkExpectedErrors()
220+
compileFilesInDir("tests/init-global/warn", defaultOptions.and("-Ysafe-init-global"), FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyBlacklisted)).checkWarnings()
220221
compileFilesInDir("tests/init-global/pos", options, FileFilter.exclude(TestSources.posInitGlobalScala2LibraryTastyBlacklisted)).checkCompile()
221222
}
222223

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

+1-1
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

+1-1
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

+1-1
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))

tests/neg-deep-subtype/i4297.scala

-13
This file was deleted.

tests/neg-macros/i9570.check

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Error: tests/neg-macros/i9570.scala:15:21 ---------------------------------------------------------------------------
2+
15 | case '{HCons(_,$t)} => // error
3+
| ^
4+
| Use of `_` for lambda in quoted pattern. Use explicit lambda instead or use `$_` to match any term.

tests/neg-macros/i9570.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ 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)} => // error
1616
sizeImpl(t,n+1)
1717
case '{HNil} => Expr(n)
1818
}
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Error: tests/neg-macros/macro-deprecation.scala:5:18 ----------------------------------------------------------------
2+
5 |inline def f = ${ impl } // error
3+
| ^^^^
4+
| method impl is deprecated

tests/neg-macros/macro-deprecation.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import scala.quoted.*
44

55
inline def f = ${ impl } // error
6-
@deprecated def impl(using Quotes) = '{1}
6+
@deprecated def impl(using Quotes) = '{1}

0 commit comments

Comments
 (0)