Skip to content

Commit 1eb9873

Browse files
tonyfettesbobzhang
authored andcommitted
chore: migrate @Alert deprecated to #deprecated
1 parent 9e3b2b9 commit 1eb9873

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+167
-167
lines changed

array/array.mbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub fn filter_map[A, B](self : Array[A], f : (A) -> B?) -> Array[B] {
169169
///
170170
/// # Returns
171171
///
172-
/// @alert deprecated "Use `Array::filter_map` instead"
172+
#deprecated("Use `Array::filter_map` instead")
173173
pub fn map_option[A, B](self : Array[A], f : (A) -> B?) -> Array[B] {
174174
self.filter_map(f)
175175
}

array/deprecated.mbt

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
/// }
4040
/// ```
4141
///
42-
/// @alert deprecated "Use `FixedArray::makei` instead"
42+
#deprecated("Use `FixedArray::makei` instead")
4343
#coverage.skip
4444
pub fn FixedArray::new[T](length : Int, value : () -> T) -> FixedArray[T] {
4545
if length <= 0 {
@@ -75,7 +75,7 @@ pub fn FixedArray::new[T](length : Int, value : () -> T) -> FixedArray[T] {
7575
/// }
7676
/// ```
7777
///
78-
/// @alert deprecated "Use `FixedArray::makei` instead"
78+
#deprecated("Use `FixedArray::makei` instead")
7979
#coverage.skip
8080
pub fn FixedArray::new_with_index[T](
8181
length : Int,
@@ -92,7 +92,7 @@ pub fn FixedArray::new_with_index[T](
9292
/// let sum = [1, 2, 3, 4, 5].fold(init=0, fn { sum, elem => sum + elem })
9393
/// assert_eq!(sum, 15)
9494
/// ```
95-
/// @alert deprecated "Use `fold` instead"
95+
#deprecated("Use `fold` instead")
9696
#coverage.skip
9797
pub fn FixedArray::fold_left[T, U](
9898
self : FixedArray[T],
@@ -110,7 +110,7 @@ pub fn FixedArray::fold_left[T, U](
110110
/// let sum = [1, 2, 3, 4, 5].rev_fold(init=0, fn { sum, elem => sum + elem })
111111
/// assert_eq!(sum, 15)
112112
/// ```
113-
/// @alert deprecated "Use `rev_fold` instead"
113+
#deprecated("Use `rev_fold` instead")
114114
#coverage.skip
115115
pub fn FixedArray::fold_right[T, U](
116116
self : FixedArray[T],
@@ -128,7 +128,7 @@ pub fn FixedArray::fold_right[T, U](
128128
/// let sum = [1, 2, 3, 4, 5].foldi(init=0, fn { index, sum, _elem => sum + index })
129129
/// assert_eq!(sum, 10)
130130
/// ```
131-
/// @alert deprecated "Use `foldi` instead"
131+
#deprecated("Use `foldi` instead")
132132
#coverage.skip
133133
pub fn FixedArray::fold_lefti[T, U](
134134
self : FixedArray[T],
@@ -146,7 +146,7 @@ pub fn FixedArray::fold_lefti[T, U](
146146
/// let sum = [1, 2, 3, 4, 5].rev_foldi(init=0, fn { index, sum, _elem => sum + index })
147147
/// assert_eq!(sum, 10)
148148
/// ```
149-
/// @alert deprecated "Use `rev_foldi` instead"
149+
#deprecated("Use `rev_foldi` instead")
150150
#coverage.skip
151151
pub fn FixedArray::fold_righti[T, U](
152152
self : FixedArray[T],

buffer/deprecated.mbt

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
///|
1616
/// Return a new string contains the data in buffer.
1717
///
18-
/// @alert deprecated "Use `Buffer::contents` to read the contents of the buffer"
18+
#deprecated("Use `Buffer::contents` to read the contents of the buffer")
1919
#coverage.skip
2020
pub fn to_string(self : T) -> String {
2121
self.contents().to_unchecked_string(offset=0, length=self.len)
@@ -26,7 +26,7 @@ pub fn to_string(self : T) -> String {
2626
/// Note this function does not validate the encoding of the byte sequence,
2727
/// it simply copy the bytes into a new String.
2828
///
29-
/// @alert deprecated "Use `Buffer::contents` to read the contents of the buffer"
29+
#deprecated("Use `Buffer::contents` to read the contents of the buffer")
3030
#coverage.skip
3131
pub fn to_unchecked_string(self : T) -> String {
3232
self.contents().to_unchecked_string(offset=0, length=self.len)
@@ -43,7 +43,7 @@ pub fn to_unchecked_string(self : T) -> String {
4343
/// * `offset` : The starting position in the source string (inclusive).
4444
/// * `length` : The number of characters to write from the starting position.
4545
///
46-
/// @alert deprecated "Use `Buffer::write_substring` instead"
46+
#deprecated("Use `Buffer::write_substring` instead")
4747
#coverage.skip
4848
pub fn write_sub_string(
4949
self : T,
@@ -55,7 +55,7 @@ pub fn write_sub_string(
5555
}
5656

5757
///|
58-
/// @alert deprecated "use `@buffer.new` instead"
58+
#deprecated("use `@buffer.new` instead")
5959
#coverage.skip
6060
pub fn T::new(size_hint~ : Int = 0) -> T {
6161
new(size_hint~)

builtin/array.mbt

+5-5
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ pub fn Array::search[T : Eq](self : Array[T], value : T) -> Int? {
958958
/// }
959959
/// ```
960960
///
961-
/// @alert deprecated "Use `search_by` instead."
961+
#deprecated("Use `search_by` instead.")
962962
#coverage.skip
963963
pub fn Array::find_index[T](self : Array[T], f : (T) -> Bool) -> Int? {
964964
self.search_by(f)
@@ -1370,7 +1370,7 @@ pub fn Array::rev_foldi[A, B](
13701370
/// let sum = [1, 2, 3, 4, 5].fold(init=0, fn { sum, elem => sum + elem })
13711371
/// assert_eq!(sum, 15)
13721372
/// ```
1373-
/// @alert deprecated "Use `fold` instead."
1373+
#deprecated("Use `fold` instead.")
13741374
#coverage.skip
13751375
pub fn Array::fold_left[T, U](self : Array[T], f : (U, T) -> U, init~ : U) -> U {
13761376
self.fold(init~, f)
@@ -1385,7 +1385,7 @@ pub fn Array::fold_left[T, U](self : Array[T], f : (U, T) -> U, init~ : U) -> U
13851385
/// let sum = [1, 2, 3, 4, 5].rev_fold(init=0, fn { sum, elem => sum + elem })
13861386
/// assert_eq!(sum, 15)
13871387
/// ```
1388-
/// @alert deprecated "Use `rev_fold` instead."
1388+
#deprecated("Use `rev_fold` instead.")
13891389
#coverage.skip
13901390
pub fn Array::fold_right[T, U](
13911391
self : Array[T],
@@ -1404,7 +1404,7 @@ pub fn Array::fold_right[T, U](
14041404
/// let sum = [1, 2, 3, 4, 5].foldi(init=0, fn { index, sum, _elem => sum + index })
14051405
/// assert_eq!(sum, 10)
14061406
/// ```
1407-
/// @alert deprecated "Use `foldi` instead."
1407+
#deprecated("Use `foldi` instead.")
14081408
#coverage.skip
14091409
pub fn Array::fold_lefti[T, U](
14101410
self : Array[T],
@@ -1423,7 +1423,7 @@ pub fn Array::fold_lefti[T, U](
14231423
/// let sum = [1, 2, 3, 4, 5].rev_foldi(init=0, fn { index, sum, _elem => sum + index })
14241424
/// assert_eq!(sum, 10)
14251425
/// ```
1426-
/// @alert deprecated "Use `rev_foldi` instead."
1426+
#deprecated("Use `rev_foldi` instead.")
14271427
#coverage.skip
14281428
pub fn Array::fold_righti[T, U](
14291429
self : Array[T],

builtin/arraycore_js.mbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub fn Array::pop[T](self : Array[T]) -> T? {
201201
}
202202
203203
///|
204-
/// @alert deprecated "Use `unsafe_pop` instead"
204+
#deprecated("Use `unsafe_pop` instead")
205205
#coverage.skip
206206
pub fn Array::pop_exn[T](self : Array[T]) -> T {
207207
self.unsafe_pop()

builtin/arraycore_nonjs.mbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ pub fn Array::pop[T](self : Array[T]) -> T? {
281281
}
282282
283283
///|
284-
/// @alert deprecated "Use `unsafe_pop` instead"
284+
#deprecated("Use `unsafe_pop` instead")
285285
#coverage.skip
286286
pub fn Array::pop_exn[T](self : Array[T]) -> T {
287287
self.unsafe_pop()

builtin/bigint_deprecated.mbt

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
///|
16-
/// @alert deprecated "Use infix bitwise operator `>>` instead"
16+
#deprecated("Use infix bitwise operator `>>` instead")
1717
#coverage.skip
1818
pub fn BigInt::asr(self : BigInt, n : Int) -> BigInt {
1919
self >> n
@@ -24,7 +24,7 @@ pub fn BigInt::asr(self : BigInt, n : Int) -> BigInt {
2424
/// The sign of the result is the same as the sign of the input.
2525
/// Only the absolute value is shifted.
2626
///
27-
/// @alert deprecated "Use infix bitwise operator `<<` instead"
27+
#deprecated("Use infix bitwise operator `<<` instead")
2828
#coverage.skip
2929
pub fn BigInt::shl(self : BigInt, n : Int) -> BigInt {
3030
self << n
@@ -35,7 +35,7 @@ pub fn BigInt::shl(self : BigInt, n : Int) -> BigInt {
3535
/// The sign of the result is the same as the sign of the input.
3636
/// Only the absolute value is shifted.
3737
///
38-
/// @alert deprecated "Use infix bitwise operator `<<` instead"
38+
#deprecated("Use infix bitwise operator `<<` instead")
3939
#coverage.skip
4040
pub fn BigInt::lsl(self : BigInt, n : Int) -> BigInt {
4141
self << n
@@ -46,7 +46,7 @@ pub fn BigInt::lsl(self : BigInt, n : Int) -> BigInt {
4646
/// The sign of the result is the same as the sign of the input.
4747
/// Only the absolute value is shifted.
4848
///
49-
/// @alert deprecated "Use infix bitwise operator `>>` instead"
49+
#deprecated("Use infix bitwise operator `>>` instead")
5050
#coverage.skip
5151
pub fn BigInt::shr(self : BigInt, n : Int) -> BigInt {
5252
self >> n

builtin/bigint_nonjs.mbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ pub fn BigInt::to_hex(self : BigInt, uppercase~ : Bool = true) -> String {
12201220
}
12211221
12221222
///|
1223-
/// @alert deprecated "Use `copy` instead"
1223+
#deprecated("Use `copy` instead")
12241224
#coverage.skip
12251225
fn BigInt::deep_clone(self : BigInt) -> BigInt {
12261226
BigInt::copy(self)

builtin/byte.mbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ pub fn Byte::op_shr(self : Byte, count : Int) -> Byte {
327327
///
328328
/// Returns the resulting `Byte` value after the bitwise left shift operation.
329329
///
330-
/// @alert deprecated "Use infix operator `<<` instead"
330+
#deprecated("Use infix operator `<<` instead")
331331
#coverage.skip
332332
pub fn Byte::lsl(self : Byte, count : Int) -> Byte {
333333
(self.to_int() << count).to_byte()
@@ -343,7 +343,7 @@ pub fn Byte::lsl(self : Byte, count : Int) -> Byte {
343343
///
344344
/// Returns the result of the logical shift right operation as a `Byte`.
345345
///
346-
/// @alert deprecated "Use infix operator `>>` instead"
346+
#deprecated("Use infix operator `>>` instead")
347347
#coverage.skip
348348
pub fn Byte::lsr(self : Byte, count : Int) -> Byte {
349349
(self.to_uint() >> count).reinterpret_as_int().to_byte()

builtin/bytes.mbt

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn unsafe_sub_string(
8686
/// Return a new unchecked string, containing the subsequence of `self` that
8787
/// starts at `byte_offset` and has length `byte_length`.
8888
///
89-
/// @alert deprecated "Use `to_unchecked_string` instead"
89+
#deprecated("Use `to_unchecked_string` instead")
9090
#coverage.skip
9191
pub fn Bytes::sub_string(
9292
self : Bytes,
@@ -118,7 +118,7 @@ pub fn Bytes::sub_string(
118118
/// }
119119
/// ```
120120
///
121-
/// @alert deprecated "Use `to_unchecked_string` instead"
121+
#deprecated("Use `to_unchecked_string` instead")
122122
#coverage.skip
123123
pub fn Bytes::to_string(self : Bytes) -> String {
124124
self.to_unchecked_string(offset=0, length=self.length())
@@ -317,7 +317,7 @@ pub fn FixedArray::set_utf8_char(
317317
/// Fill utf16 encoded char `value` into byte sequence `self`, starting at `offset`.
318318
/// It return the length of bytes has been written.
319319
/// @alert unsafe "Panic if the [value] is out of range"
320-
/// @alert deprecated "Use `set_utf16le_char` instead"
320+
#deprecated("Use `set_utf16le_char` instead")
321321
#coverage.skip
322322
pub fn FixedArray::set_utf16_char(
323323
self : FixedArray[Byte],

builtin/console.mbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub fn println[T : Show](input : T) -> Unit {
4141
4242
///|
4343
/// Prints and returns the value of a given expression for quick and dirty debugging.
44-
/// @alert deprecated "This function is for debugging only and should not be used in production"
44+
#deprecated("This function is for debugging only and should not be used in production")
4545
pub fn dump[T](t : T, name? : String, loc~ : SourceLoc = _) -> T {
4646
let name = match name {
4747
Some(name) => name

builtin/int64_js.mbt

+13-13
Original file line numberDiff line numberDiff line change
@@ -422,35 +422,35 @@ pub fn Int64::lxor(self : Int64, other : Int64) -> Int64 {
422422
}
423423

424424
///|
425-
/// @alert deprecated "Use infix operator `<<` instead"
425+
#deprecated("Use infix operator `<<` instead")
426426
#coverage.skip
427427
pub fn Int64::lsl(self : Int64, other : Int) -> Int64 {
428428
MyInt64::from_int64(self).lsl(other).to_int64()
429429
}
430430

431431
///|
432-
/// @alert deprecated "Use infix operator `<<` instead"
432+
#deprecated("Use infix operator `<<` instead")
433433
#coverage.skip
434434
pub fn Int64::shl(self : Int64, other : Int) -> Int64 {
435435
MyInt64::from_int64(self).lsl(other).to_int64()
436436
}
437437

438438
///|
439-
/// @alert deprecated "Use UInt64 type and infix operator `>>` instead"
439+
#deprecated("Use UInt64 type and infix operator `>>` instead")
440440
#coverage.skip
441441
pub fn Int64::lsr(self : Int64, other : Int) -> Int64 {
442442
MyInt64::from_int64(self).lsr(other).to_int64()
443443
}
444444

445445
///|
446-
/// @alert deprecated "Use infix operator `>>` instead"
446+
#deprecated("Use infix operator `>>` instead")
447447
#coverage.skip
448448
pub fn Int64::shr(self : Int64, other : Int) -> Int64 {
449449
MyInt64::from_int64(self).asr(other).to_int64()
450450
}
451451

452452
///|
453-
/// @alert deprecated "Use infix operator `>>` instead"
453+
#deprecated("Use infix operator `>>` instead")
454454
#coverage.skip
455455
pub fn Int64::asr(self : Int64, other : Int) -> Int64 {
456456
MyInt64::from_int64(self).asr(other).to_int64()
@@ -557,7 +557,7 @@ pub fn UInt16::to_int64(self : UInt16) -> Int64 {
557557
}
558558

559559
///|
560-
/// @alert deprecated "Use `reinterpret_as_int64` instead"
560+
#deprecated("Use `reinterpret_as_int64` instead")
561561
#coverage.skip
562562
pub fn Double::reinterpret_as_i64(self : Double) -> Int64 {
563563
MyInt64::reinterpret_double(self).to_int64()
@@ -569,7 +569,7 @@ pub fn Double::reinterpret_as_int64(self : Double) -> Int64 {
569569
}
570570

571571
///|
572-
/// @alert deprecated "Use `reinterpret_as_uint64` instead"
572+
#deprecated("Use `reinterpret_as_uint64` instead")
573573
#coverage.skip
574574
pub fn Double::reinterpret_as_u64(self : Double) -> UInt64 {
575575
MyInt64::reinterpret_double(self).to_uint64()
@@ -597,7 +597,7 @@ fn MyInt64::to_uint64(self : MyInt64) -> UInt64 = "%identity"
597597
fn MyInt64::from_uint64(value : UInt64) -> MyInt64 = "%identity"
598598

599599
///|
600-
/// @alert deprecated "Use `reinterpret_as_uint64` instead"
600+
#deprecated("Use `reinterpret_as_uint64` instead")
601601
#coverage.skip
602602
pub fn Int64::to_uint64(self : Int64) -> UInt64 = "%identity"
603603

@@ -630,7 +630,7 @@ pub fn UInt64::op_mod(self : UInt64, other : UInt64) -> UInt64 {
630630
}
631631

632632
///|
633-
/// @alert deprecated "Use reinterpret_as_int64 instead"
633+
#deprecated("Use reinterpret_as_int64 instead")
634634
#coverage.skip
635635
pub fn UInt64::to_int64(self : UInt64) -> Int64 = "%identity"
636636

@@ -688,28 +688,28 @@ pub fn UInt64::lnot(self : UInt64) -> UInt64 {
688688
}
689689

690690
///|
691-
/// @alert deprecated "Use infix operator `<<` instead"
691+
#deprecated("Use infix operator `<<` instead")
692692
#coverage.skip
693693
pub fn UInt64::lsl(self : UInt64, shift : Int) -> UInt64 {
694694
MyInt64::lsl(MyInt64::from_uint64(self), shift).to_uint64()
695695
}
696696

697697
///|
698-
/// @alert deprecated "Use infix operator `<<` instead"
698+
#deprecated("Use infix operator `<<` instead")
699699
#coverage.skip
700700
pub fn UInt64::lsr(self : UInt64, shift : Int) -> UInt64 {
701701
MyInt64::lsr(MyInt64::from_uint64(self), shift).to_uint64()
702702
}
703703

704704
///|
705-
/// @alert deprecated "Use infix operator `>>` instead"
705+
#deprecated("Use infix operator `>>` instead")
706706
#coverage.skip
707707
pub fn UInt64::shl(self : UInt64, shift : Int) -> UInt64 {
708708
MyInt64::lsl(MyInt64::from_uint64(self), shift).to_uint64()
709709
}
710710

711711
///|
712-
/// @alert deprecated "Use infix operator `>>` instead"
712+
#deprecated("Use infix operator `>>` instead")
713713
#coverage.skip
714714
pub fn UInt64::shr(self : UInt64, shift : Int) -> UInt64 {
715715
MyInt64::lsr(MyInt64::from_uint64(self), shift).to_uint64()

0 commit comments

Comments
 (0)