Skip to content

Commit 99fdcc1

Browse files
committed
remove the usage of @elidable from the library
1 parent 9a8746e commit 99fdcc1

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

library/src/scala/Predef.scala

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import scala.language.`2.13`
1616
import scala.language.implicitConversions
1717

1818
import 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 }
2020
import scala.annotation.meta.{ companionClass, companionMethod }
2121
import scala.annotation.internal.{ RuntimeChecked }
2222
import 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
}

0 commit comments

Comments
 (0)