154
154
# * #trap: Specifies the handling of system signals.
155
155
# * #warn: Issue a warning based on the given messages and options.
156
156
#
157
- %a{annotate:rdoc:source:from=object.c}
158
157
module Kernel : BasicObject
159
158
# <!--
160
159
# rdoc-file=vm_backtrace.c
@@ -191,9 +190,9 @@ module Kernel : BasicObject
191
190
# c(4) #=> []
192
191
# c(5) #=> nil
193
192
#
194
- def self?.caller : (Integer start_or_range, ?Integer length ) -> :: Array[String]?
195
- | (::Range[Integer] start_or_range ) -> :: Array[String]?
196
- | () -> :: Array[String]
193
+ def self?.caller : () -> Array[String]
194
+ | (int start, ?int? length ) -> Array[String]?
195
+ | (range[int?] range ) -> Array[String]?
197
196
198
197
# <!--
199
198
# rdoc-file=vm_backtrace.c
@@ -216,8 +215,9 @@ module Kernel : BasicObject
216
215
# Optionally you can pass a range, which will return an array containing the
217
216
# entries within the specified range.
218
217
#
219
- def self?.caller_locations : (?Integer start_or_range, ?Integer length) -> ::Array[Thread::Backtrace::Location]?
220
- | (?::Range[Integer] start_or_range) -> ::Array[Thread::Backtrace::Location]?
218
+ def self?.caller_locations : () -> Array[Thread::Backtrace::Location]
219
+ | (int start, ?int? length) -> Array[Thread::Backtrace::Location]?
220
+ | (range[int?] range) -> Array[Thread::Backtrace::Location]?
221
221
222
222
# <!--
223
223
# rdoc-file=vm_eval.c
@@ -269,8 +269,8 @@ module Kernel : BasicObject
269
269
#
270
270
# # => 123
271
271
#
272
- def self?.catch : [T] (T tag ) { (T tag) -> untyped } -> untyped
273
- | ( ) { (Object tag) -> untyped } -> untyped
272
+ def self?.catch : ( ) { (Object tag) -> untyped } -> untyped
273
+ | [T] (T tag ) { (T tag) -> untyped } -> untyped
274
274
275
275
# <!--
276
276
# rdoc-file=kernel.rb
@@ -334,7 +334,7 @@ module Kernel : BasicObject
334
334
# end
335
335
# local_variables #=> [:fred, :i]
336
336
#
337
- def self?.local_variables : () -> :: Array[Symbol]
337
+ def self?.local_variables : () -> Array[Symbol]
338
338
339
339
# <!--
340
340
# rdoc-file=random.c
@@ -441,7 +441,7 @@ module Kernel : BasicObject
441
441
#
442
442
def self?.Array : (nil ) -> []
443
443
| [T] (array[T] | _ToA[T] array_like) -> Array[T]
444
- | [T] (T ele ) -> [T]
444
+ | [T] (T element ) -> [T]
445
445
446
446
# <!--
447
447
# rdoc-file=complex.c
@@ -495,8 +495,8 @@ module Kernel : BasicObject
495
495
#
496
496
def self?.Complex : (_ToC complex_like, ?exception: true) -> Complex
497
497
| (_ToC complex_like, exception: bool ) -> Complex?
498
- | (Numeric | String real, ?Numeric | String imag, ?exception: true) -> Complex
499
- | (Numeric | String real, ?Numeric | String imag, exception: bool ) -> Complex?
498
+ | (Numeric | String real, ?( Numeric & _ToF) | String imag, ?exception: true) -> Complex
499
+ | (Numeric | String real, ?( Numeric & _ToF) | String imag, exception: bool ) -> Complex?
500
500
| (untyped , ?untyped , ?exception: bool ) -> Complex?
501
501
502
502
# <!--
@@ -541,7 +541,7 @@ module Kernel : BasicObject
541
541
# Hash(nil) # => {}
542
542
# Hash([]) # => {}
543
543
#
544
- def self?.Hash : [K, V] (nil | [] _empty ) -> Hash[K, V]
544
+ def self?.Hash : [K, V] ([]? ) -> Hash[K, V]
545
545
| [K, V] (hash[K, V] hash_like) -> Hash[K, V]
546
546
547
547
# <!--
@@ -678,6 +678,7 @@ module Kernel : BasicObject
678
678
| [T] (Numeric&_RationalDiv[T] numer, Numeric denom, ?exception: bool ) -> T
679
679
| [T < Numeric] (T value, 1, ?exception: bool ) -> T
680
680
| (untyped , ?untyped , ?exception: bool ) -> Rational?
681
+ | (__todo__) -> __todo__
681
682
682
683
interface _RationalDiv [T]
683
684
def / : (Numeric) -> T
@@ -747,7 +748,7 @@ module Kernel : BasicObject
747
748
#
748
749
# The built-in syntax `%x{...}` uses this method.
749
750
#
750
- def self?.` : (String arg0 ) -> String
751
+ def self?.` : (string command ) -> String
751
752
752
753
# <!--
753
754
# rdoc-file=process.c
@@ -796,7 +797,7 @@ module Kernel : BasicObject
796
797
# If *const* is defined as autoload, the file name to be loaded is replaced with
797
798
# *filename*. If *const* is defined but not as autoload, does nothing.
798
799
#
799
- def self?.autoload : (interned _module, String filename) -> NilClass
800
+ def self?.autoload : (interned const, path filename) -> nil
800
801
801
802
# <!--
802
803
# rdoc-file=load.c
@@ -807,7 +808,7 @@ module Kernel : BasicObject
807
808
# autoload(:B, "b")
808
809
# autoload?(:B) #=> "b"
809
810
#
810
- def self?.autoload? : (interned name) -> String?
811
+ def self?.autoload? : (interned name, ?boolish inherit ) -> String?
811
812
812
813
# <!--
813
814
# rdoc-file=proc.c
@@ -931,8 +932,7 @@ module Kernel : BasicObject
931
932
#
932
933
def self?.fail : () -> bot
933
934
| (string message, ?cause: Exception?) -> bot
934
- | (_Exception exception, ?_ToS? message, ?String | Array[String] | nil backtrace, ?cause: Exception?) -> bot
935
- | (_Exception exception, ?cause: Exception?, **untyped ) -> bot
935
+ | [T] (Exception::_Exception[T] exception, ?T message, ?Array[String] | String | Thread::Backtrace | nil backtrace, ?cause: Exception?) -> bot
936
936
937
937
# <!--
938
938
# rdoc-file=eval.c
@@ -964,26 +964,28 @@ module Kernel : BasicObject
964
964
965
965
alias self .raise self .fail
966
966
967
- # <!-- rdoc-file=object.c -->
967
+ # <!--
968
+ # rdoc-file=object.c
969
+ # - sprintf(format_string *objects) -> string
970
+ # -->
968
971
# Returns the string resulting from formatting `objects` into `format_string`.
969
972
#
970
973
# For details on `format_string`, see [Format
971
974
# Specifications](rdoc-ref:format_specifications.rdoc).
972
975
#
973
- def self?.format : (String format, *untyped args) -> String
976
+ def self?.sprintf : (string format, hash[Symbol, untyped ] keywords) -> String
977
+ | (string format, **untyped keywords) -> String
978
+ | (string format, *untyped positional) -> String
974
979
975
- # <!--
976
- # rdoc-file=object.c
977
- # - sprintf(format_string *objects) -> string
978
- # -->
980
+ # <!-- rdoc-file=object.c -->
979
981
# Returns the string resulting from formatting `objects` into `format_string`.
980
982
#
981
983
# For details on `format_string`, see [Format
982
984
# Specifications](rdoc-ref:format_specifications.rdoc).
983
985
#
984
- alias sprintf format
986
+ alias format sprintf
985
987
986
- alias self .sprintf self .format
988
+ alias self .format self .sprintf
987
989
988
990
# <!--
989
991
# rdoc-file=io.c
@@ -1015,7 +1017,8 @@ module Kernel : BasicObject
1015
1017
# The style of programming using `$_` as an implicit parameter is gradually
1016
1018
# losing favor in the Ruby community.
1017
1019
#
1018
- def self?.gets : (?String arg0, ?Integer arg1) -> String?
1020
+ def self?.gets : (?string? separator, ?int limit, ?chomp: boolish) -> String?
1021
+ | (int limit, ?chomp: boolish) -> String?
1019
1022
1020
1023
# <!--
1021
1024
# rdoc-file=eval.c
@@ -1027,7 +1030,7 @@ module Kernel : BasicObject
1027
1030
#
1028
1031
# global_variables.grep /std/ #=> [:$stdin, :$stdout, :$stderr]
1029
1032
#
1030
- def self?.global_variables : () -> :: Array[Symbol]
1033
+ def self?.global_variables : () -> Array[Symbol]
1031
1034
1032
1035
# <!--
1033
1036
# rdoc-file=load.c
@@ -1056,7 +1059,7 @@ module Kernel : BasicObject
1056
1059
# executed under the given module. In no circumstance will any local variables
1057
1060
# in the loaded file be propagated to the loading environment.
1058
1061
#
1059
- def self?.load : (String filename, ?Module | bool ) -> bool
1062
+ def self?.load : (path filename, ?Module | bool wrap ) -> true
1060
1063
1061
1064
# <!--
1062
1065
# rdoc-file=kernel.rb
@@ -1087,8 +1090,8 @@ module Kernel : BasicObject
1087
1090
# puts enum.next
1088
1091
# } #=> :ok
1089
1092
#
1090
- def self?.loop : () { () -> void } -> bot
1091
- | () -> ::Enumerator[ nil , bot ]
1093
+ def self?.loop : () -> Enumerator[ nil , untyped ]
1094
+ | () { () -> void } -> untyped
1092
1095
1093
1096
# <!--
1094
1097
# rdoc-file=io.c
@@ -1165,7 +1168,7 @@ module Kernel : BasicObject
1165
1168
# gets # Sets $_ to the most recent user input.
1166
1169
# print # Prints $_.
1167
1170
#
1168
- def self?.print : (*_ToS args ) -> nil
1171
+ def self?.print : (*_ToS objects ) -> nil
1169
1172
1170
1173
# <!--
1171
1174
# rdoc-file=io.c
@@ -1200,16 +1203,20 @@ module Kernel : BasicObject
1200
1203
# With no arguments, does nothing.
1201
1204
#
1202
1205
def self?.printf : () -> nil
1203
- | (String fmt, *untyped args) -> nil
1204
- | (_Writer io, string fmt, *untyped args) -> nil
1206
+ | (String fmt, hash[Symbol, untyped ] keywords) -> nil
1207
+ | (String fmt, **untyped keywords) -> nil
1208
+ | (String fmt, *untyped positional) -> nil
1209
+ | (_Writer io, string fmt, hash[Symbol, untyped ] keywords) -> nil
1210
+ | (_Writer io, string fmt, **untyped keywords) -> nil
1211
+ | (_Writer io, string fmt, *untyped positional) -> nil
1205
1212
1206
1213
# <!--
1207
1214
# rdoc-file=proc.c
1208
1215
# - proc { |...| block } -> a_proc
1209
1216
# -->
1210
1217
# Equivalent to Proc.new.
1211
1218
#
1212
- def self?.proc : () { () -> untyped } -> Proc
1219
+ def self?.proc : () { (? ) -> untyped } -> Proc
1213
1220
1214
1221
# <!--
1215
1222
# rdoc-file=proc.c
@@ -1218,7 +1225,7 @@ module Kernel : BasicObject
1218
1225
# Equivalent to Proc.new, except the resulting Proc objects check the number of
1219
1226
# parameters passed when called.
1220
1227
#
1221
- def self?.lambda : () { () -> untyped } -> Proc
1228
+ def self?.lambda : () { (? ) -> untyped } -> Proc
1222
1229
1223
1230
# <!--
1224
1231
# rdoc-file=io.c
@@ -1230,8 +1237,8 @@ module Kernel : BasicObject
1230
1237
#
1231
1238
# See IO#putc for important information regarding multi-byte characters.
1232
1239
#
1233
- def self?.putc : [T < _ToInt] (T chr) -> T
1234
- | (String chr) -> String
1240
+ def self?.putc : (String chr) -> String
1241
+ | [T < _ToInt] (T chr) -> T
1235
1242
1236
1243
# <!--
1237
1244
# rdoc-file=io.c
@@ -1272,9 +1279,9 @@ module Kernel : BasicObject
1272
1279
# Kernel#p to be uninterruptible in whole or in part. On CRuby, Kernel#p's
1273
1280
# writing of data is uninterruptible.
1274
1281
#
1275
- def self?.p : [T < _Inspect] (T arg0 ) -> T
1276
- | (_Inspect arg0, _Inspect arg1, *_Inspect rest ) -> Array[_Inspect]
1277
- | ( ) -> nil
1282
+ def self?.p : ( ) -> nil
1283
+ | [T < _Inspect] (T object ) -> T
1284
+ | [T < _Inspect] (T object1, T object2, *T objects ) -> Array[T]
1278
1285
1279
1286
# <!--
1280
1287
# rdoc-file=lib/pp.rb
@@ -1284,9 +1291,9 @@ module Kernel : BasicObject
1284
1291
#
1285
1292
# pp returns argument(s).
1286
1293
#
1287
- def self?.pp : [T] (T arg0 ) -> T
1288
- | ( untyped , untyped , * untyped ) -> Array[ untyped ]
1289
- | ( ) -> nil
1294
+ def self?.pp : ( ) -> nil
1295
+ | [T < PP::_PrettyPrint] (T object ) -> T
1296
+ | [T < PP::_PrettyPrint] (T object1, T object2, *T objects ) -> Array[T]
1290
1297
1291
1298
# <!--
1292
1299
# rdoc-file=random.c
@@ -1339,7 +1346,8 @@ module Kernel : BasicObject
1339
1346
# Optional keyword argument `chomp` specifies whether line separators are to be
1340
1347
# omitted.
1341
1348
#
1342
- def self?.readline : (?String arg0, ?Integer arg1) -> String
1349
+ def self?.readline : (?string? separator, ?int limit, ?chomp: boolish) -> String
1350
+ | (int limit, ?chomp: boolish) -> String
1343
1351
1344
1352
# <!--
1345
1353
# rdoc-file=io.c
@@ -1394,7 +1402,8 @@ module Kernel : BasicObject
1394
1402
# Optional keyword arguments `enc_opts` specify encoding options; see [Encoding
1395
1403
# options](rdoc-ref:encodings.rdoc@Encoding+Options).
1396
1404
#
1397
- def self?.readlines : (?String arg0, ?Integer arg1) -> ::Array[String]
1405
+ def self?.readlines : (?string? separator, ?int limit, ?chomp: boolish) -> Array[String]
1406
+ | (int limit, ?chomp: boolish) -> Array[String]
1398
1407
1399
1408
# <!--
1400
1409
# rdoc-file=lib/rubygems/core_ext/kernel_require.rb
@@ -1412,7 +1421,7 @@ module Kernel : BasicObject
1412
1421
# The normal `require` functionality of returning false if that file has already
1413
1422
# been loaded is preserved.
1414
1423
#
1415
- def self?.require : (String path) -> bool
1424
+ def self?.require : (path feature ) -> bool
1416
1425
1417
1426
# <!--
1418
1427
# rdoc-file=load.c
@@ -1423,7 +1432,7 @@ module Kernel : BasicObject
1423
1432
# raised. Returns `true` if the file was loaded and `false` if the file was
1424
1433
# already loaded before.
1425
1434
#
1426
- def self?.require_relative : (String feature) -> bool
1435
+ def self?.require_relative : (path feature) -> bool
1427
1436
1428
1437
# <!--
1429
1438
# rdoc-file=io.c
@@ -1564,7 +1573,14 @@ module Kernel : BasicObject
1564
1573
# (snipped)
1565
1574
# ping
1566
1575
#
1567
- def self?.select : (::Array[IO] read, ?::Array[IO] write, ?::Array[IO] error, ?Time::_Timeout timeout) -> ::Array[String]
1576
+ def self?.select : ([]?, ?[]?, ?[]?, ?nil ) -> bot
1577
+ | [R < _ToIO] (Array[R] read, ?[]?, ?[]?, ?nil ) -> [Array[R], [], []]
1578
+ | [R < _ToIO] (Array[R] read, []?, []?, Time::_Timeout timeout) -> [Array[R], [], []]?
1579
+ | [R < _ToIO, W < _ToIO] (Array[R] read, ?Array[W] write, ?[]?, ?nil ) -> [Array[R], Array[W], []]
1580
+ | [R < _ToIO, W < _ToIO] (Array[R] read, Array[W] write, []?, Time::_Timeout timeout) -> [Array[R], Array[W], []]?
1581
+ | [R < _ToIO, W < _ToIO, E < _ToIO] (Array[R] read, ?Array[W] write, ?Array[E] error, ?nil ) -> [Array[R], Array[W], Array[E]]
1582
+ | [R < _ToIO, W < _ToIO, E < _ToIO] (Array[R] read, Array[W] write, Array[E] error, Time::_Timeout timeout) -> [Array[R], Array[W], Array[E]]?
1583
+ | (Array[_ToIO]? read, ?Array[_ToIO]? write, ?Array[_ToIO]? error, ?Time::_Timeout? timeout) -> [Array[_ToIO], Array[_ToIO], Array[_ToIO]]?
1568
1584
1569
1585
# <!--
1570
1586
# rdoc-file=process.c
@@ -1670,7 +1686,12 @@ module Kernel : BasicObject
1670
1686
# ">" | boolean | True if the modification time of file1
1671
1687
# | | is after that of file2
1672
1688
#
1673
- def self?.test : (String | Integer cmd, String | IO file1, ?String | IO file2) -> (TrueClass | FalseClass | Time | nil | Integer)
1689
+ def self?.test : ('b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'G' | 'k' | 'o' | 'O' | 'p' | 'S' | 'u' | 'z' | 98 | 99 | 100 | 101 | 102 | 103 | 71 | 107 | 111 | 79 | 112 | 83 | 117 | 122, IO | path file) -> bool
1690
+ | ('l' | 'r' | 'R' | 'w' | 'W' | 'x' | 'X' | 108 | 114 | 82 | 119 | 87 | 120 | 88, path filename) -> bool
1691
+ | ('s' | 115, IO | path filename) -> Integer?
1692
+ | ('M' | 'A' | 'C' | 77 | 65 | 67, IO | path file) -> Time
1693
+ | ('-' | '=' | '<' | '>' | 45 | 60 | 61 | 62, IO | path file1, IO | path file2) -> bool
1694
+ | (String | int cmd, IO | path file1, ?IO | path file2) -> (bool | Integer? | Time)
1674
1695
1675
1696
# <!--
1676
1697
# rdoc-file=vm_eval.c
@@ -1728,7 +1749,7 @@ module Kernel : BasicObject
1728
1749
# :experimental
1729
1750
# : Used for experimental features that may change in future releases.
1730
1751
#
1731
- def self?.warn : (*_ToS msg , ?uplevel: int?, ?category: Warning::category? ) -> nil
1752
+ def self?.warn : (*_ToS msgs , ?uplevel: int?, ?category: Warning::category | _ToSym | nil ) -> nil
1732
1753
1733
1754
# <!--
1734
1755
# rdoc-file=process.c
0 commit comments