Skip to content

Commit

Permalink
Fix checks outside of testCompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
szymon-rd committed Nov 21, 2023
1 parent 9dbd8aa commit 71a66c4
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 7 deletions.
13 changes: 8 additions & 5 deletions compiler/test-resources/repl/rewrite-messages
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
//> using options -source:future-migration -deprecation -Werror
scala> import scala.util._
-- Error: ----------------------------------------------------------------------
-- Migration Warning: ----------------------------------------------------------
1 | import scala.util._
| ^
| `_` is no longer supported for a wildcard import; use `*` instead

No warnings can be incurred under -Werror.
1 warning found
1 error found
scala> extension (x: Int) def foo(y: Int) = x + y
def foo(x: Int)(y: Int): Int

scala> 2 foo 4
-- Error: ----------------------------------------------------------------------
-- Migration Warning: ----------------------------------------------------------
1 | 2 foo 4
| ^^^
|Alphanumeric method foo is not declared infix; it should not be used as infix operator.
|Instead, use method syntax .foo(...) or backticked identifier `foo`.
1 error found
No warnings can be incurred under -Werror.
1 warning found
1 error found
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.
4 changes: 3 additions & 1 deletion tests/neg-macros/i9570.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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)
}
Expand All @@ -24,3 +24,5 @@ object Macros {

}
}

// nopos-error No warnings can be incurred under -Werror.
5 changes: 5 additions & 0 deletions tests/neg-macros/macro-deprecation.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Deprecation Warning: tests/neg-macros/macro-deprecation.scala:5:18 --------------------------------------------------
5 |inline def f = ${ impl } // warn (in .check file)
| ^^^^
| method impl is deprecated
No warnings can be incurred under -Werror.
4 changes: 3 additions & 1 deletion tests/neg-macros/macro-deprecation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

import scala.quoted.*

inline def f = ${ impl } // error
inline def f = ${ impl } // warn (in .check file)
@deprecated def impl(using Quotes) = '{1}

// nopos-error No warnings can be incurred under -Werror.
1 change: 1 addition & 0 deletions tests/patmat/i14407.dupe.check
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
6: Match case Unreachable
0: No Kind
1 change: 1 addition & 0 deletions tests/patmat/i18118.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
21: Pattern Match
32: Pattern Match
41: Pattern Match
0: No Kind

0 comments on commit 71a66c4

Please sign in to comment.