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
@@ -699,7 +700,6 @@ module Kernel : BasicObject
699
700
#
700
701
def self?.String : (string | _ToS string_like) -> String
701
702
702
- # <!--
703
703
# rdoc-file=eval.c
704
704
# - __callee__ -> symbol
705
705
# -->
@@ -747,7 +747,7 @@ module Kernel : BasicObject
747
747
#
748
748
# The built-in syntax `%x{...}` uses this method.
749
749
#
750
- def self?.` : (String arg0 ) -> String
750
+ def self?.` : (string command ) -> String
751
751
752
752
# <!--
753
753
# rdoc-file=process.c
@@ -796,7 +796,7 @@ module Kernel : BasicObject
796
796
# If *const* is defined as autoload, the file name to be loaded is replaced with
797
797
# *filename*. If *const* is defined but not as autoload, does nothing.
798
798
#
799
- def self?.autoload : (interned _module, String filename) -> NilClass
799
+ def self?.autoload : (interned const, path filename) -> nil
800
800
801
801
# <!--
802
802
# rdoc-file=load.c
@@ -807,7 +807,7 @@ module Kernel : BasicObject
807
807
# autoload(:B, "b")
808
808
# autoload?(:B) #=> "b"
809
809
#
810
- def self?.autoload? : (interned name) -> String?
810
+ def self?.autoload? : (interned name, ?boolish inherit ) -> String?
811
811
812
812
# <!--
813
813
# rdoc-file=proc.c
@@ -931,8 +931,7 @@ module Kernel : BasicObject
931
931
#
932
932
def self?.fail : () -> bot
933
933
| (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
934
+ | [T] (Exception::_Exception[T] exception, ?T message, ?Array[String] | String | Thread::Backtrace | nil backtrace, ?cause: Exception?) -> bot
936
935
937
936
# <!--
938
937
# rdoc-file=eval.c
@@ -970,7 +969,9 @@ module Kernel : BasicObject
970
969
# For details on `format_string`, see [Format
971
970
# Specifications](rdoc-ref:format_specifications.rdoc).
972
971
#
973
- def self?.format : (String format, *untyped args) -> String
972
+ def self?.sprintf : (string format, hash[Symbol, untyped ] keywords) -> String
973
+ | (string format, **untyped keywords) -> String
974
+ | (string format, *untyped positional) -> String
974
975
975
976
# <!--
976
977
# rdoc-file=object.c
@@ -981,9 +982,9 @@ module Kernel : BasicObject
981
982
# For details on `format_string`, see [Format
982
983
# Specifications](rdoc-ref:format_specifications.rdoc).
983
984
#
984
- alias sprintf format
985
+ alias format sprintf
985
986
986
- alias self .sprintf self .format
987
+ alias self .format self .sprintf
987
988
988
989
# <!--
989
990
# rdoc-file=io.c
@@ -1015,7 +1016,8 @@ module Kernel : BasicObject
1015
1016
# The style of programming using `$_` as an implicit parameter is gradually
1016
1017
# losing favor in the Ruby community.
1017
1018
#
1018
- def self?.gets : (?String arg0, ?Integer arg1) -> String?
1019
+ def self?.gets : (?string? separator, ?int limit, ?chomp: boolish) -> String?
1020
+ | (int limit, ?chomp: boolish) -> String?
1019
1021
1020
1022
# <!--
1021
1023
# rdoc-file=eval.c
@@ -1027,7 +1029,7 @@ module Kernel : BasicObject
1027
1029
#
1028
1030
# global_variables.grep /std/ #=> [:$stdin, :$stdout, :$stderr]
1029
1031
#
1030
- def self?.global_variables : () -> :: Array[Symbol]
1032
+ def self?.global_variables : () -> Array[Symbol]
1031
1033
1032
1034
# <!--
1033
1035
# rdoc-file=load.c
@@ -1056,7 +1058,7 @@ module Kernel : BasicObject
1056
1058
# executed under the given module. In no circumstance will any local variables
1057
1059
# in the loaded file be propagated to the loading environment.
1058
1060
#
1059
- def self?.load : (String filename, ?Module | bool ) -> bool
1061
+ def self?.load : (path filename, ?Module | bool wrap ) -> true
1060
1062
1061
1063
# <!--
1062
1064
# rdoc-file=kernel.rb
@@ -1087,8 +1089,8 @@ module Kernel : BasicObject
1087
1089
# puts enum.next
1088
1090
# } #=> :ok
1089
1091
#
1090
- def self?.loop : () { () -> void } -> bot
1091
- | () -> ::Enumerator[ nil , bot ]
1092
+ def self?.loop : () -> Enumerator[ nil , untyped ]
1093
+ | () { () -> void } -> untyped
1092
1094
1093
1095
# <!--
1094
1096
# rdoc-file=io.c
@@ -1165,7 +1167,7 @@ module Kernel : BasicObject
1165
1167
# gets # Sets $_ to the most recent user input.
1166
1168
# print # Prints $_.
1167
1169
#
1168
- def self?.print : (*_ToS args ) -> nil
1170
+ def self?.print : (*_ToS objects ) -> nil
1169
1171
1170
1172
# <!--
1171
1173
# rdoc-file=io.c
@@ -1200,16 +1202,20 @@ module Kernel : BasicObject
1200
1202
# With no arguments, does nothing.
1201
1203
#
1202
1204
def self?.printf : () -> nil
1203
- | (String fmt, *untyped args) -> nil
1204
- | (_Writer io, string fmt, *untyped args) -> nil
1205
+ | (String fmt, hash[Symbol, untyped ] keywords) -> nil
1206
+ | (String fmt, **untyped keywords) -> nil
1207
+ | (String fmt, *untyped positional) -> nil
1208
+ | (_Writer io, string fmt, hash[Symbol, untyped ] keywords) -> nil
1209
+ | (_Writer io, string fmt, **untyped keywords) -> nil
1210
+ | (_Writer io, string fmt, *untyped positional) -> nil
1205
1211
1206
1212
# <!--
1207
1213
# rdoc-file=proc.c
1208
1214
# - proc { |...| block } -> a_proc
1209
1215
# -->
1210
1216
# Equivalent to Proc.new.
1211
1217
#
1212
- def self?.proc : () { () -> untyped } -> Proc
1218
+ def self?.proc : () { (? ) -> untyped } -> Proc
1213
1219
1214
1220
# <!--
1215
1221
# rdoc-file=proc.c
@@ -1218,7 +1224,7 @@ module Kernel : BasicObject
1218
1224
# Equivalent to Proc.new, except the resulting Proc objects check the number of
1219
1225
# parameters passed when called.
1220
1226
#
1221
- def self?.lambda : () { () -> untyped } -> Proc
1227
+ def self?.lambda : () { (? ) -> untyped } -> Proc
1222
1228
1223
1229
# <!--
1224
1230
# rdoc-file=io.c
@@ -1230,8 +1236,8 @@ module Kernel : BasicObject
1230
1236
#
1231
1237
# See IO#putc for important information regarding multi-byte characters.
1232
1238
#
1233
- def self?.putc : [T < _ToInt] (T chr) -> T
1234
- | (String chr) -> String
1239
+ def self?.putc : (String chr) -> String
1240
+ | [T < _ToInt] (T chr) -> T
1235
1241
1236
1242
# <!--
1237
1243
# rdoc-file=io.c
@@ -1272,9 +1278,9 @@ module Kernel : BasicObject
1272
1278
# Kernel#p to be uninterruptible in whole or in part. On CRuby, Kernel#p's
1273
1279
# writing of data is uninterruptible.
1274
1280
#
1275
- def self?.p : [T < _Inspect] (T arg0 ) -> T
1276
- | (_Inspect arg0, _Inspect arg1, *_Inspect rest ) -> Array[_Inspect]
1277
- | ( ) -> nil
1281
+ def self?.p : ( ) -> nil
1282
+ | [T < _Inspect] (T object ) -> T
1283
+ | [T < _Inspect] (T object1, T object2, *T objects ) -> Array[T]
1278
1284
1279
1285
# <!--
1280
1286
# rdoc-file=lib/pp.rb
@@ -1284,9 +1290,9 @@ module Kernel : BasicObject
1284
1290
#
1285
1291
# pp returns argument(s).
1286
1292
#
1287
- def self?.pp : [T] (T arg0 ) -> T
1288
- | ( untyped , untyped , * untyped ) -> Array[ untyped ]
1289
- | ( ) -> nil
1293
+ def self?.pp : ( ) -> nil
1294
+ | [T < PP::_PrettyPrint] (T object ) -> T
1295
+ | [T < PP::_PrettyPrint] (T object1, T object2, *T objects ) -> Array[T]
1290
1296
1291
1297
# <!--
1292
1298
# rdoc-file=random.c
@@ -1339,7 +1345,8 @@ module Kernel : BasicObject
1339
1345
# Optional keyword argument `chomp` specifies whether line separators are to be
1340
1346
# omitted.
1341
1347
#
1342
- def self?.readline : (?String arg0, ?Integer arg1) -> String
1348
+ def self?.readline : (?string? separator, ?int limit, ?chomp: boolish) -> String
1349
+ | (int limit, ?chomp: boolish) -> String
1343
1350
1344
1351
# <!--
1345
1352
# rdoc-file=io.c
@@ -1394,7 +1401,8 @@ module Kernel : BasicObject
1394
1401
# Optional keyword arguments `enc_opts` specify encoding options; see [Encoding
1395
1402
# options](rdoc-ref:encodings.rdoc@Encoding+Options).
1396
1403
#
1397
- def self?.readlines : (?String arg0, ?Integer arg1) -> ::Array[String]
1404
+ def self?.readlines : (?string? separator, ?int limit, ?chomp: boolish) -> Array[String]
1405
+ | (int limit, ?chomp: boolish) -> Array[String]
1398
1406
1399
1407
# <!--
1400
1408
# rdoc-file=lib/rubygems/core_ext/kernel_require.rb
@@ -1412,7 +1420,7 @@ module Kernel : BasicObject
1412
1420
# The normal `require` functionality of returning false if that file has already
1413
1421
# been loaded is preserved.
1414
1422
#
1415
- def self?.require : (String path) -> bool
1423
+ def self?.require : (path feature ) -> bool
1416
1424
1417
1425
# <!--
1418
1426
# rdoc-file=load.c
@@ -1423,7 +1431,7 @@ module Kernel : BasicObject
1423
1431
# raised. Returns `true` if the file was loaded and `false` if the file was
1424
1432
# already loaded before.
1425
1433
#
1426
- def self?.require_relative : (String feature) -> bool
1434
+ def self?.require_relative : (path feature) -> bool
1427
1435
1428
1436
# <!--
1429
1437
# rdoc-file=io.c
@@ -1564,7 +1572,14 @@ module Kernel : BasicObject
1564
1572
# (snipped)
1565
1573
# ping
1566
1574
#
1567
- def self?.select : (::Array[IO] read, ?::Array[IO] write, ?::Array[IO] error, ?Time::_Timeout timeout) -> ::Array[String]
1575
+ def self?.select : ([]?, ?[]?, ?[]?, ?nil ) -> bot
1576
+ | [R < _ToIO] (Array[R] read, ?[]?, ?[]?, ?nil ) -> [Array[R], [], []]
1577
+ | [R < _ToIO] (Array[R] read, []?, []?, Time::_Timeout timeout) -> [Array[R], [], []]?
1578
+ | [R < _ToIO, W < _ToIO] (Array[R] read, ?Array[W] write, ?[]?, ?nil ) -> [Array[R], Array[W], []]
1579
+ | [R < _ToIO, W < _ToIO] (Array[R] read, Array[W] write, []?, Time::_Timeout timeout) -> [Array[R], Array[W], []]?
1580
+ | [R < _ToIO, W < _ToIO, E < _ToIO] (Array[R] read, ?Array[W] write, ?Array[E] error, ?nil ) -> [Array[R], Array[W], Array[E]]
1581
+ | [R < _ToIO, W < _ToIO, E < _ToIO] (Array[R] read, Array[W] write, Array[E] error, Time::_Timeout timeout) -> [Array[R], Array[W], Array[E]]?
1582
+ | (Array[_ToIO]? read, ?Array[_ToIO]? write, ?Array[_ToIO]? error, ?Time_Timeout? timeout) -> [Array[_ToIO], Array[_ToIO], Array[_ToIO]]?
1568
1583
1569
1584
# <!--
1570
1585
# rdoc-file=process.c
@@ -1670,7 +1685,12 @@ module Kernel : BasicObject
1670
1685
# ">" | boolean | True if the modification time of file1
1671
1686
# | | is after that of file2
1672
1687
#
1673
- def self?.test : (String | Integer cmd, String | IO file1, ?String | IO file2) -> (TrueClass | FalseClass | Time | nil | Integer)
1688
+ 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
1689
+ | ('l' | 'r' | 'R' | 'w' | 'W' | 'x' | 'X' | 108 | 114 | 82 | 119 | 87 | 120 | 88, path filename) -> bool
1690
+ | ('s' | 115, IO | path filename) -> Integer?
1691
+ | ('M' | 'A' | 'C' | 77 | 65 | 67, IO | path file) -> Time
1692
+ | ('-' | '=' | '<' | '>' | 45 | 60 | 61 | 62, IO | path file1, IO | path file2) -> bool
1693
+ | (String | int cmd, IO | path file1, ?IO | path file2) -> (bool | Integer? | Time)
1674
1694
1675
1695
# <!--
1676
1696
# rdoc-file=vm_eval.c
@@ -1728,7 +1748,7 @@ module Kernel : BasicObject
1728
1748
# :experimental
1729
1749
# : Used for experimental features that may change in future releases.
1730
1750
#
1731
- def self?.warn : (*_ToS msg , ?uplevel: int?, ?category: Warning::category? ) -> nil
1751
+ def self?.warn : (*_ToS msgs , ?uplevel: int?, ?category: Warning::category | _ToSym | nil ) -> nil
1732
1752
1733
1753
# <!--
1734
1754
# rdoc-file=process.c
0 commit comments