Skip to content

Commit

Permalink
Third batch of neg -> warn test changes
Browse files Browse the repository at this point in the history
[Cherry-picked 59b0b69][modified]
  • Loading branch information
WojciechMazur committed Jun 27, 2024
1 parent 41bb644 commit c471c78
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 53 deletions.
13 changes: 0 additions & 13 deletions tests/neg-deep-subtype/i4297.scala

This file was deleted.

4 changes: 4 additions & 0 deletions tests/neg-macros/i9570.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Error: tests/neg-macros/i9570.scala:15:21 ---------------------------------------------------------------------------
15 | case '{HCons(_,$t)} => // error
| ^
| Use of `_` for lambda in quoted pattern. Use explicit lambda instead or use `$_` to match any term.
2 changes: 1 addition & 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)} => // error
sizeImpl(t,n+1)
case '{HNil} => Expr(n)
}
Expand Down
4 changes: 4 additions & 0 deletions tests/neg-macros/macro-deprecation.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- Error: tests/neg-macros/macro-deprecation.scala:5:18 ----------------------------------------------------------------
5 |inline def f = ${ impl } // error
| ^^^^
| method impl is deprecated
2 changes: 1 addition & 1 deletion tests/neg-macros/macro-deprecation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
import scala.quoted.*

inline def f = ${ impl } // error
@deprecated def impl(using Quotes) = '{1}
@deprecated def impl(using Quotes) = '{1}
49 changes: 25 additions & 24 deletions tests/neg-scalajs/enumeration-warnings.check
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
-- Error: tests/neg-scalajs/enumeration-warnings.scala:6:4 -------------------------------------------------------------
6 | Value // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:6:4 -----------------------------------------------------------
6 | Value // warn
| ^^^^^
| Could not transform call to scala.Enumeration.Value.
| The resulting program is unlikely to function properly as this operation requires reflection.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:10:9 ------------------------------------------------------------
10 | Value(4) // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:10:9 ----------------------------------------------------------
10 | Value(4) // warn
| ^^^^^^^^
| Could not transform call to scala.Enumeration.Value.
| The resulting program is unlikely to function properly as this operation requires reflection.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:15:15 -----------------------------------------------------------
15 | val a = Value(null) // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:15:15 ---------------------------------------------------------
15 | val a = Value(null) // warn
| ^^^^^^^^^^^
| Passing null as name to scala.Enumeration.Value requires reflection at run-time.
| The resulting program is unlikely to function properly.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:16:15 -----------------------------------------------------------
16 | val b = Value(10, null) // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:16:15 ---------------------------------------------------------
16 | val b = Value(10, null) // warn
| ^^^^^^^^^^^^^^^
| Passing null as name to scala.Enumeration.Value requires reflection at run-time.
| The resulting program is unlikely to function properly.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:20:10 -----------------------------------------------------------
20 | val a = new Val // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:20:10 ---------------------------------------------------------
20 | val a = new Val // warn
| ^^^^^^^
| Calls to the non-string constructors of scala.Enumeration.Val require reflection at run-time.
| The resulting program is unlikely to function properly.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:21:10 -----------------------------------------------------------
21 | val b = new Val(10) // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:21:10 ---------------------------------------------------------
21 | val b = new Val(10) // warn
| ^^^^^^^^^^^
| Calls to the non-string constructors of scala.Enumeration.Val require reflection at run-time.
| The resulting program is unlikely to function properly.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:25:10 -----------------------------------------------------------
25 | val a = new Val(null) // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:25:10 ---------------------------------------------------------
25 | val a = new Val(null) // warn
| ^^^^^^^^^^^^^
| Passing null as name to a constructor of scala.Enumeration.Val requires reflection at run-time.
| The resulting program is unlikely to function properly.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:26:10 -----------------------------------------------------------
26 | val b = new Val(10, null) // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:26:10 ---------------------------------------------------------
26 | val b = new Val(10, null) // warn
| ^^^^^^^^^^^^^^^^^
| Passing null as name to a constructor of scala.Enumeration.Val requires reflection at run-time.
| The resulting program is unlikely to function properly.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:30:31 -----------------------------------------------------------
30 | protected class Val1 extends Val // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:30:31 ---------------------------------------------------------
30 | protected class Val1 extends Val // warn
| ^^^
| Calls to the non-string constructors of scala.Enumeration.Val require reflection at run-time.
| The resulting program is unlikely to function properly.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:31:31 -----------------------------------------------------------
31 | protected class Val2 extends Val(1) // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:31:31 ---------------------------------------------------------
31 | protected class Val2 extends Val(1) // warn
| ^^^^^^
| Calls to the non-string constructors of scala.Enumeration.Val require reflection at run-time.
| The resulting program is unlikely to function properly.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:35:31 -----------------------------------------------------------
35 | protected class Val1 extends Val(null) // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:35:31 ---------------------------------------------------------
35 | protected class Val1 extends Val(null) // warn
| ^^^^^^^^^
| Passing null as name to a constructor of scala.Enumeration.Val requires reflection at run-time.
| The resulting program is unlikely to function properly.
-- Error: tests/neg-scalajs/enumeration-warnings.scala:36:31 -----------------------------------------------------------
36 | protected class Val2 extends Val(1, null) // error
-- Warning: tests/neg-scalajs/enumeration-warnings.scala:36:31 ---------------------------------------------------------
36 | protected class Val2 extends Val(1, null) // warn
| ^^^^^^^^^^^^
| Passing null as name to a constructor of scala.Enumeration.Val requires reflection at run-time.
| The resulting program is unlikely to function properly.
No warnings can be incurred under -Werror.
26 changes: 14 additions & 12 deletions tests/neg-scalajs/enumeration-warnings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,37 @@
class UnableToTransformValue extends Enumeration {
val a = {
println("oh, oh!")
Value // error
Value // warn
}
val b = {
println("oh, oh!")
Value(4) // error
Value(4) // warn
}
}

class ValueWithNullName extends Enumeration {
val a = Value(null) // error
val b = Value(10, null) // error
val a = Value(null) // warn
val b = Value(10, null) // warn
}

class NewValWithNoName extends Enumeration {
val a = new Val // error
val b = new Val(10) // error
val a = new Val // warn
val b = new Val(10) // warn
}

class NewValWithNullName extends Enumeration {
val a = new Val(null) // error
val b = new Val(10, null) // error
val a = new Val(null) // warn
val b = new Val(10, null) // warn
}

class ExtendsValWithNoName extends Enumeration {
protected class Val1 extends Val // error
protected class Val2 extends Val(1) // error
protected class Val1 extends Val // warn
protected class Val2 extends Val(1) // warn
}

class ExtendsValWithNullName extends Enumeration {
protected class Val1 extends Val(null) // error
protected class Val2 extends Val(1, null) // error
protected class Val1 extends Val(null) // warn
protected class Val2 extends Val(1, null) // warn
}

// 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
4 changes: 2 additions & 2 deletions tests/run/getclass.check
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ class [D
class [Lscala.collection.immutable.List;

Functions:
class Test$$$Lambda$
class Test$$$Lambda$
class Test$$$Lambda/
class Test$$$Lambda/

0 comments on commit c471c78

Please sign in to comment.