@@ -16,7 +16,7 @@ import scala.language.`2.13`
1616import scala .language .implicitConversions
1717
1818import scala .collection .{mutable , immutable , ArrayOps , StringOps }, immutable .WrappedString
19- import scala .annotation .{elidable , experimental , implicitNotFound , publicInBinary , targetName }, elidable . ASSERTION
19+ import scala .annotation .{experimental , implicitNotFound , publicInBinary , targetName , nowarn }
2020import scala .annotation .meta .{ companionClass , companionMethod }
2121import scala .annotation .internal .{ RuntimeChecked }
2222import scala .compiletime .summonFrom
@@ -36,9 +36,7 @@ import scala.runtime.ScalaRunTime.mapNull
3636 *
3737 * === Assertions ===
3838 * A set of `assert` functions are provided for use as a way to document
39- * and dynamically check invariants in code. Invocations of `assert` can be elided
40- * at compile time by providing the command line option `-Xdisable-assertions`,
41- * which raises `-Xelide-below` above `elidable.ASSERTION`, to the `scalac` command.
39+ * and dynamically check invariants in code.
4240 *
4341 * Variants of `assert` intended for use with static analysis tools are also
4442 * provided: `assume`, `require` and `ensuring`. `require` and `ensuring` are
@@ -298,29 +296,23 @@ object Predef extends LowPriorityImplicits {
298296 */
299297
300298 /** Tests an expression, throwing an `AssertionError` if false.
301- * Calls to this method will not be generated if `-Xelide-below`
302- * is greater than `ASSERTION`.
303299 *
304- * @see [[scala.annotation.elidable elidable ]]
305300 * @param assertion the expression to test
306301 * @group assertions
307302 */
308- @ elidable( ASSERTION ) @ publicInBinary
303+ @ publicInBinary
309304 @ targetName(" assert" ) private [scala] def scala2Assert (assertion : Boolean ): Unit = {
310305 if (! assertion)
311306 throw new java.lang.AssertionError (" assertion failed" )
312307 }
313308
314309 /** Tests an expression, throwing an `AssertionError` if false.
315- * Calls to this method will not be generated if `-Xelide-below`
316- * is greater than `ASSERTION`.
317310 *
318- * @see [[scala.annotation.elidable elidable ]]
319311 * @param assertion the expression to test
320312 * @param message a String to include in the failure message
321313 * @group assertions
322314 */
323- @ elidable( ASSERTION ) @ inline @ publicInBinary
315+ @ inline @ publicInBinary
324316 @ targetName(" assert" ) private [scala] final def scala2Assert (assertion : Boolean , message : => Any ): Unit = {
325317 if (! assertion)
326318 throw new java.lang.AssertionError (" assertion failed: " + message)
@@ -339,14 +331,11 @@ object Predef extends LowPriorityImplicits {
339331 /** Tests an expression, throwing an `AssertionError` if false.
340332 * This method differs from assert only in the intent expressed:
341333 * assert contains a predicate which needs to be proven, while
342- * assume contains an axiom for a static checker. Calls to this method
343- * will not be generated if `-Xelide-below` is greater than `ASSERTION`.
334+ * assume contains an axiom for a static checker.
344335 *
345- * @see [[scala.annotation.elidable elidable ]]
346336 * @param assumption the expression to test
347337 * @group assertions
348338 */
349- @ elidable(ASSERTION )
350339 def assume (assumption : Boolean ): Unit = {
351340 if (! assumption)
352341 throw new java.lang.AssertionError (" assumption failed" )
@@ -355,16 +344,13 @@ object Predef extends LowPriorityImplicits {
355344 /** Tests an expression, throwing an `AssertionError` if false.
356345 * This method differs from assert only in the intent expressed:
357346 * assert contains a predicate which needs to be proven, while
358- * assume contains an axiom for a static checker. Calls to this method
359- * will not be generated if `-Xelide-below` is greater than `ASSERTION`.
347+ * assume contains an axiom for a static checker.
360348 *
361- * @see [[scala.annotation.elidable elidable ]]
362349 * @param assumption the expression to test
363350 * @param message a String to include in the failure message
364351 * @group assertions
365352 */
366- @ elidable(ASSERTION ) @ inline
367- final def assume (assumption : Boolean , message : => Any ): Unit = {
353+ @ inline final def assume (assumption : Boolean , message : => Any ): Unit = {
368354 if (! assumption)
369355 throw new java.lang.AssertionError (" assumption failed: " + message)
370356 }
@@ -504,7 +490,9 @@ object Predef extends LowPriorityImplicits {
504490
505491 // these two are morally deprecated but the @deprecated annotation has been moved to the extension method themselves,
506492 // in order to provide a more specific deprecation method.
493+ @ nowarn(""" cat=deprecation&origin=scala\.runtime\.Tuple2Zipped""" )
507494 implicit def tuple2ToZippedOps [T1 , T2 ](x : (T1 , T2 )): runtime.Tuple2Zipped .Ops [T1 , T2 ] = new runtime.Tuple2Zipped .Ops (x)
495+ @ nowarn(""" cat=deprecation&origin=scala\.runtime\.Tuple3Zipped""" )
508496 implicit def tuple3ToZippedOps [T1 , T2 , T3 ](x : (T1 , T2 , T3 )): runtime.Tuple3Zipped .Ops [T1 , T2 , T3 ] = new runtime.Tuple3Zipped .Ops (x)
509497
510498 // Not specialized anymore since 2.13 but we still need separate methods
0 commit comments