Skip to content

Commit

Permalink
Third batch of neg -> warn test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
szymon-rd committed Dec 15, 2023
1 parent d7fdaf3 commit 78adb39
Show file tree
Hide file tree
Showing 28 changed files with 69 additions and 339 deletions.
3 changes: 3 additions & 0 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ class CompilationTests {
@Test def checkInitGlobal: Unit = {
implicit val testGroup: TestGroup = TestGroup("checkInitGlobal")
val options = defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings")
compileFilesInDir("tests/init-global/neg", options).checkExpectedErrors()
compileFilesInDir("tests/init-global/pos", options).checkCompile()
compileFilesInDir("tests/init-global/neg", options, FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyBlacklisted)).checkExpectedErrors()
compileFilesInDir("tests/init-global/warn", defaultOptions.and("-Ysafe-init-global"), FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyBlacklisted)).checkWarnings()
compileFilesInDir("tests/init-global/pos", options, FileFilter.exclude(TestSources.posInitGlobalScala2LibraryTastyBlacklisted)).checkCompile()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ object Test:
class Box(val x: Int)

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

recur(Box(1), Box(2))
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ object Test:
class Box(val x: Int)

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

recur(Box(1), Box(2))
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ object Test:
class Box(val x: Int)

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

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

class Hello { // error
class Hello { // warn
val x: Int = 1
}
// nopos-error: werror
11 changes: 0 additions & 11 deletions tests/neg-deep-subtype/1828.scala

This file was deleted.

11 changes: 0 additions & 11 deletions tests/neg-deep-subtype/3324b.scala

This file was deleted.

11 changes: 0 additions & 11 deletions tests/neg-deep-subtype/3324f.scala

This file was deleted.

21 changes: 0 additions & 21 deletions tests/neg-deep-subtype/3324g.scala

This file was deleted.

31 changes: 0 additions & 31 deletions tests/neg-deep-subtype/JavaSeqLiteral.scala

This file was deleted.

15 changes: 0 additions & 15 deletions tests/neg-deep-subtype/conditionalWarnings.scala

This file was deleted.

15 changes: 0 additions & 15 deletions tests/neg-deep-subtype/gadt.scala

This file was deleted.

20 changes: 0 additions & 20 deletions tests/neg-deep-subtype/html.scala

This file was deleted.

6 changes: 0 additions & 6 deletions tests/neg-deep-subtype/i3324.scala

This file was deleted.

13 changes: 0 additions & 13 deletions tests/neg-deep-subtype/i4297.scala

This file was deleted.

40 changes: 0 additions & 40 deletions tests/neg-deep-subtype/or-type-trees.scala

This file was deleted.

24 changes: 0 additions & 24 deletions tests/neg-deep-subtype/refined-types.scala

This file was deleted.

60 changes: 0 additions & 60 deletions tests/neg-deep-subtype/t2755.scala

This file was deleted.

16 changes: 0 additions & 16 deletions tests/neg-deep-subtype/type-lambda.scala

This file was deleted.

5 changes: 5 additions & 0 deletions tests/neg-macros/i9570.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Warning: tests/neg-macros/i9570.scala:15:21 -------------------------------------------------------------------------
15 | case '{HCons(_,$t)} => // warn (in .check file)
| ^
| Use of `_` for lambda in quoted pattern. Use explicit lambda instead or use `$_` to match any term.
No warnings can be incurred under -Werror.
6 changes: 4 additions & 2 deletions tests/neg-macros/i9570.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ object Macros {
private def sizeImpl(e: Expr[HList], n:Int)(using qctx:Quotes): Expr[Int] = {
import quotes.reflect.*
e match {
case '{HCons(_,$t)} => // error if run with fatal warinings in BootstrappedOnlyCompilationTests
case '{HCons(_,$t)} => // warn (in .check file)
sizeImpl(t,n+1)
case '{HNil} => Expr(n)
}
}

inline def size(inline expr: HList ): Int = {
${sizeImpl('expr,0)}
}
}

}
}

// nopos-error No warnings can be incurred under -Werror.
Loading

0 comments on commit 78adb39

Please sign in to comment.