rbi 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/rbi/rbi.rbi CHANGED
@@ -20,10 +20,11 @@ class RBI::Arg < ::RBI::Node
20
20
  def value; end
21
21
  end
22
22
 
23
- # @abstract
24
23
  class RBI::Attr < ::RBI::NodeWithComments
25
24
  include ::RBI::Indexable
26
25
 
26
+ abstract!
27
+
27
28
  sig do
28
29
  params(
29
30
  name: ::Symbol,
@@ -39,11 +40,9 @@ class RBI::Attr < ::RBI::NodeWithComments
39
40
  sig { override.params(other: ::RBI::Node).returns(T::Boolean) }
40
41
  def compatible_with?(other); end
41
42
 
42
- # @abstract
43
43
  sig { abstract.returns(T::Array[::RBI::Method]) }
44
44
  def convert_to_methods; end
45
45
 
46
- # @abstract
47
46
  sig { abstract.returns(T::Array[::String]) }
48
47
  def fully_qualified_names; end
49
48
 
@@ -62,7 +61,6 @@ class RBI::Attr < ::RBI::NodeWithComments
62
61
  sig { returns(::RBI::Visibility) }
63
62
  def visibility; end
64
63
 
65
- # @return [Visibility]
66
64
  def visibility=(_arg0); end
67
65
 
68
66
  private
@@ -90,7 +88,6 @@ class RBI::Attr < ::RBI::NodeWithComments
90
88
  end
91
89
  def create_setter_method(name, sig, attribute_type, visibility, loc, comments); end
92
90
 
93
- # @raise [UnexpectedMultipleSigsError]
94
91
  sig(:final) { returns([T.nilable(::RBI::Sig), T.nilable(T.any(::RBI::Type, ::String))]) }
95
92
  def parse_sig; end
96
93
  end
@@ -176,7 +173,6 @@ class RBI::AttrWriter < ::RBI::Attr
176
173
  def to_s; end
177
174
  end
178
175
 
179
- # An arbitrary blank line that can be added both in trees and comments
180
176
  class RBI::BlankLine < ::RBI::Comment
181
177
  sig { params(loc: T.nilable(::RBI::Loc)).void }
182
178
  def initialize(loc: T.unsafe(nil)); end
@@ -221,13 +217,11 @@ class RBI::Class < ::RBI::Scope
221
217
  sig { returns(::String) }
222
218
  def name; end
223
219
 
224
- # @return [String]
225
220
  def name=(_arg0); end
226
221
 
227
222
  sig { returns(T.nilable(::String)) }
228
223
  def superclass_name; end
229
224
 
230
- # @return [String, nil]
231
225
  def superclass_name=(_arg0); end
232
226
  end
233
227
 
@@ -241,24 +235,9 @@ class RBI::Comment < ::RBI::Node
241
235
  sig { returns(::String) }
242
236
  def text; end
243
237
 
244
- # @return [String]
245
238
  def text=(_arg0); end
246
239
  end
247
240
 
248
- # A tree showing incompatibles nodes
249
- #
250
- # Is rendered as a merge conflict between `left` and` right`:
251
- # ~~~rb
252
- # class Foo
253
- # <<<<<<< left
254
- # def m1; end
255
- # def m2(a); end
256
- # =======
257
- # def m1(a); end
258
- # def m2; end
259
- # >>>>>>> right
260
- # end
261
- # ~~~
262
241
  class RBI::ConflictTree < ::RBI::Tree
263
242
  sig { params(left_name: ::String, right_name: ::String).void }
264
243
  def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end
@@ -269,14 +248,10 @@ class RBI::ConflictTree < ::RBI::Tree
269
248
  sig { returns(::String) }
270
249
  def left_name; end
271
250
 
272
- # @return [Tree]
273
251
  def right; end
274
-
275
- # @return [String]
276
252
  def right_name; end
277
253
  end
278
254
 
279
- # Consts
280
255
  class RBI::Const < ::RBI::NodeWithComments
281
256
  include ::RBI::Indexable
282
257
 
@@ -306,7 +281,6 @@ class RBI::Const < ::RBI::NodeWithComments
306
281
  sig { override.returns(::String) }
307
282
  def to_s; end
308
283
 
309
- # @return [String]
310
284
  def value; end
311
285
  end
312
286
 
@@ -353,7 +327,6 @@ class RBI::File
353
327
  sig { returns(T::Array[::RBI::Comment]) }
354
328
  def comments; end
355
329
 
356
- # @return [Array<Comment>]
357
330
  def comments=(_arg0); end
358
331
 
359
332
  sig { returns(T::Boolean) }
@@ -378,13 +351,11 @@ class RBI::File
378
351
  sig { returns(::RBI::Tree) }
379
352
  def root; end
380
353
 
381
- # @return [Tree]
382
354
  def root=(_arg0); end
383
355
 
384
356
  sig { returns(T.nilable(::String)) }
385
357
  def strictness; end
386
358
 
387
- # @return [String, nil]
388
359
  def strictness=(_arg0); end
389
360
 
390
361
  sig { params(indent: ::Integer, print_locs: T::Boolean, max_line_length: T.nilable(::Integer)).returns(::String) }
@@ -414,7 +385,6 @@ class RBI::Formatter
414
385
  sig { returns(T.nilable(::Integer)) }
415
386
  def max_line_length; end
416
387
 
417
- # @return [Integer, nil]
418
388
  def max_line_length=(_arg0); end
419
389
 
420
390
  sig { params(file: ::RBI::File).returns(::String) }
@@ -437,48 +407,21 @@ class RBI::Group::Kind
437
407
  end
438
408
  end
439
409
 
440
- # : Kind
441
410
  RBI::Group::Kind::Attrs = T.let(T.unsafe(nil), RBI::Group::Kind)
442
-
443
- # : Kind
444
411
  RBI::Group::Kind::Consts = T.let(T.unsafe(nil), RBI::Group::Kind)
445
-
446
- # : Kind
447
412
  RBI::Group::Kind::Helpers = T.let(T.unsafe(nil), RBI::Group::Kind)
448
-
449
- # : Kind
450
413
  RBI::Group::Kind::Inits = T.let(T.unsafe(nil), RBI::Group::Kind)
451
-
452
- # : Kind
453
414
  RBI::Group::Kind::Methods = T.let(T.unsafe(nil), RBI::Group::Kind)
454
-
455
- # : Kind
456
415
  RBI::Group::Kind::MixesInClassMethods = T.let(T.unsafe(nil), RBI::Group::Kind)
457
-
458
- # : Kind
459
416
  RBI::Group::Kind::Mixins = T.let(T.unsafe(nil), RBI::Group::Kind)
460
-
461
- # : Kind
462
417
  RBI::Group::Kind::RequiredAncestors = T.let(T.unsafe(nil), RBI::Group::Kind)
463
-
464
- # : Kind
465
418
  RBI::Group::Kind::Sends = T.let(T.unsafe(nil), RBI::Group::Kind)
466
-
467
- # : Kind
468
419
  RBI::Group::Kind::SingletonClasses = T.let(T.unsafe(nil), RBI::Group::Kind)
469
-
470
- # : Kind
471
420
  RBI::Group::Kind::TEnums = T.let(T.unsafe(nil), RBI::Group::Kind)
472
-
473
- # : Kind
474
421
  RBI::Group::Kind::TStructFields = T.let(T.unsafe(nil), RBI::Group::Kind)
475
-
476
- # : Kind
477
422
  RBI::Group::Kind::TypeMembers = T.let(T.unsafe(nil), RBI::Group::Kind)
478
-
479
423
  class RBI::GroupNodesError < ::RBI::Error; end
480
424
 
481
- # Sorbet's misc.
482
425
  class RBI::Helper < ::RBI::NodeWithComments
483
426
  include ::RBI::Indexable
484
427
 
@@ -556,14 +499,9 @@ class RBI::Index < ::RBI::Visitor
556
499
  end
557
500
  end
558
501
 
559
- # A Node that can be referred to by a unique ID inside an index
560
502
  module RBI::Indexable
561
- # Unique IDs that refer to this node.
562
- #
563
- # Some nodes can have multiple ids, for example an attribute accessor matches the ID of the
564
- # getter and the setter.
565
- #
566
- # @abstract
503
+ interface!
504
+
567
505
  sig { abstract.returns(T::Array[::String]) }
568
506
  def index_ids; end
569
507
  end
@@ -652,16 +590,12 @@ class RBI::Loc
652
590
  end
653
591
  def initialize(file: T.unsafe(nil), begin_line: T.unsafe(nil), end_line: T.unsafe(nil), begin_column: T.unsafe(nil), end_column: T.unsafe(nil)); end
654
592
 
655
- # @return [Integer, nil]
656
593
  def begin_column; end
657
594
 
658
595
  sig { returns(T.nilable(::Integer)) }
659
596
  def begin_line; end
660
597
 
661
- # @return [Integer, nil]
662
598
  def end_column; end
663
-
664
- # @return [Integer, nil]
665
599
  def end_line; end
666
600
 
667
601
  sig { returns(T.nilable(::String)) }
@@ -682,7 +616,6 @@ class RBI::Loc
682
616
  end
683
617
  end
684
618
 
685
- # A tree that _might_ contain conflicts
686
619
  class RBI::MergeTree < ::RBI::Tree
687
620
  sig do
688
621
  params(
@@ -698,7 +631,6 @@ class RBI::MergeTree < ::RBI::Tree
698
631
  def conflicts; end
699
632
  end
700
633
 
701
- # Methods and args
702
634
  class RBI::Method < ::RBI::NodeWithComments
703
635
  include ::RBI::Indexable
704
636
 
@@ -767,7 +699,6 @@ class RBI::Method < ::RBI::NodeWithComments
767
699
  sig { returns(T::Boolean) }
768
700
  def is_singleton; end
769
701
 
770
- # @return [Boolean]
771
702
  def is_singleton=(_arg0); end
772
703
 
773
704
  sig { override.params(other: ::RBI::Node).void }
@@ -776,7 +707,6 @@ class RBI::Method < ::RBI::NodeWithComments
776
707
  sig { returns(::String) }
777
708
  def name; end
778
709
 
779
- # @return [String]
780
710
  def name=(_arg0); end
781
711
 
782
712
  sig { returns(T::Array[::RBI::Param]) }
@@ -785,7 +715,6 @@ class RBI::Method < ::RBI::NodeWithComments
785
715
  sig { returns(T::Array[::RBI::Sig]) }
786
716
  def sigs; end
787
717
 
788
- # @return [Array<Sig>]
789
718
  def sigs=(_arg0); end
790
719
 
791
720
  sig { override.returns(::String) }
@@ -794,7 +723,6 @@ class RBI::Method < ::RBI::NodeWithComments
794
723
  sig { returns(::RBI::Visibility) }
795
724
  def visibility; end
796
725
 
797
- # @return [Visibility]
798
726
  def visibility=(_arg0); end
799
727
  end
800
728
 
@@ -822,8 +750,9 @@ class RBI::MixesInClassMethods < ::RBI::Mixin
822
750
  def to_s; end
823
751
  end
824
752
 
825
- # @abstract
826
753
  class RBI::Mixin < ::RBI::NodeWithComments
754
+ abstract!
755
+
827
756
  sig do
828
757
  params(
829
758
  name: ::String,
@@ -861,16 +790,15 @@ class RBI::Module < ::RBI::Scope
861
790
  sig { returns(::String) }
862
791
  def name; end
863
792
 
864
- # @return [String]
865
793
  def name=(_arg0); end
866
794
  end
867
795
 
868
- # @abstract
869
796
  class RBI::Node
797
+ abstract!
798
+
870
799
  sig { params(loc: T.nilable(::RBI::Loc)).void }
871
800
  def initialize(loc: T.unsafe(nil)); end
872
801
 
873
- # Can `self` and `_other` be merged into a single definition?
874
802
  sig { params(_other: ::RBI::Node).returns(T::Boolean) }
875
803
  def compatible_with?(_other); end
876
804
 
@@ -880,10 +808,8 @@ class RBI::Node
880
808
  sig { returns(T.nilable(::RBI::Loc)) }
881
809
  def loc; end
882
810
 
883
- # @return [Loc, nil]
884
811
  def loc=(_arg0); end
885
812
 
886
- # Merge `self` and `other` into a single definition
887
813
  sig { params(other: ::RBI::Node).void }
888
814
  def merge_with(other); end
889
815
 
@@ -896,7 +822,6 @@ class RBI::Node
896
822
  sig { returns(T.nilable(::RBI::Tree)) }
897
823
  def parent_tree; end
898
824
 
899
- # @return [Tree, nil]
900
825
  def parent_tree=(_arg0); end
901
826
 
902
827
  sig do
@@ -922,7 +847,6 @@ class RBI::Node
922
847
  sig { params(indent: ::Integer, print_locs: T::Boolean, positional_names: T::Boolean).returns(::String) }
923
848
  def rbs_string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), positional_names: T.unsafe(nil)); end
924
849
 
925
- # @raise [ReplaceNodeError]
926
850
  sig { params(node: ::RBI::Node).void }
927
851
  def replace(node); end
928
852
 
@@ -933,8 +857,9 @@ class RBI::Node
933
857
  def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil), max_line_length: T.unsafe(nil)); end
934
858
  end
935
859
 
936
- # @abstract
937
860
  class RBI::NodeWithComments < ::RBI::Node
861
+ abstract!
862
+
938
863
  sig { params(loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void }
939
864
  def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil)); end
940
865
 
@@ -944,7 +869,6 @@ class RBI::NodeWithComments < ::RBI::Node
944
869
  sig { returns(T::Array[::RBI::Comment]) }
945
870
  def comments; end
946
871
 
947
- # @return [Array<Comment>]
948
872
  def comments=(_arg0); end
949
873
 
950
874
  sig { override.params(other: ::RBI::Node).void }
@@ -973,8 +897,9 @@ class RBI::OptParam < ::RBI::Param
973
897
  def value; end
974
898
  end
975
899
 
976
- # @abstract
977
900
  class RBI::Param < ::RBI::NodeWithComments
901
+ abstract!
902
+
978
903
  sig { params(name: ::String, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void }
979
904
  def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil)); end
980
905
 
@@ -1043,6 +968,9 @@ class RBI::Parser::SigBuilder < ::RBI::Parser::Visitor
1043
968
  sig { params(content: ::String, file: ::String).void }
1044
969
  def initialize(content, file:); end
1045
970
 
971
+ sig { params(node: ::Prism::CallNode, value: ::String).returns(T::Boolean) }
972
+ def allow_incompatible_override?(node, value); end
973
+
1046
974
  sig { returns(::RBI::Sig) }
1047
975
  def current; end
1048
976
 
@@ -1092,11 +1020,9 @@ class RBI::Parser::TreeBuilder < ::RBI::Parser::Visitor
1092
1020
 
1093
1021
  private
1094
1022
 
1095
- # Collect all the remaining comments within a node
1096
1023
  sig { params(node: ::Prism::Node).void }
1097
1024
  def collect_dangling_comments(node); end
1098
1025
 
1099
- # Collect all the remaining comments after visiting the tree
1100
1026
  sig { void }
1101
1027
  def collect_orphan_comments; end
1102
1028
 
@@ -1192,13 +1118,9 @@ class RBI::Printer < ::RBI::Visitor
1192
1118
  sig { void }
1193
1119
  def dedent; end
1194
1120
 
1195
- # @return [Boolean]
1196
1121
  def in_visibility_group; end
1197
-
1198
- # @return [Boolean]
1199
1122
  def in_visibility_group=(_arg0); end
1200
1123
 
1201
- # Printing
1202
1124
  sig { void }
1203
1125
  def indent; end
1204
1126
 
@@ -1208,25 +1130,20 @@ class RBI::Printer < ::RBI::Visitor
1208
1130
  sig { returns(T.nilable(::RBI::Node)) }
1209
1131
  def previous_node; end
1210
1132
 
1211
- # Print a string without indentation nor `\n` at the end.
1212
1133
  sig { params(string: ::String).void }
1213
1134
  def print(string); end
1214
1135
 
1215
1136
  sig { returns(T::Boolean) }
1216
1137
  def print_locs; end
1217
1138
 
1218
- # @return [Boolean]
1219
1139
  def print_locs=(_arg0); end
1220
1140
 
1221
- # Print a string with indentation and `\n` at the end.
1222
1141
  sig { params(string: ::String).void }
1223
1142
  def printl(string); end
1224
1143
 
1225
- # Print a string without indentation but with a `\n` at the end.
1226
1144
  sig { params(string: T.nilable(::String)).void }
1227
1145
  def printn(string = T.unsafe(nil)); end
1228
1146
 
1229
- # Print a string with indentation but without a `\n` at the end.
1230
1147
  sig { params(string: T.nilable(::String)).void }
1231
1148
  def printt(string = T.unsafe(nil)); end
1232
1149
 
@@ -1471,7 +1388,6 @@ class RBI::RBS::MethodTypeTranslator
1471
1388
  sig { params(type: T.untyped).returns(::RBI::Type) }
1472
1389
  def translate_type(type); end
1473
1390
 
1474
- # @raise [Error]
1475
1391
  sig { params(type: ::RBS::Types::Block).void }
1476
1392
  def visit_block_type(type); end
1477
1393
 
@@ -1505,10 +1421,12 @@ class RBI::RBS::TypeTranslator
1505
1421
 
1506
1422
  sig { params(type_name: ::String).returns(::String) }
1507
1423
  def translate_t_generic_type(type_name); end
1424
+
1425
+ sig { params(type: ::RBS::Types::Alias).returns(::RBI::Type) }
1426
+ def translate_type_alias(type); end
1508
1427
  end
1509
1428
  end
1510
1429
 
1511
- # A comment representing a RBS type prefixed with `#:`
1512
1430
  class RBI::RBSComment < ::RBI::Comment
1513
1431
  sig { params(other: ::Object).returns(T::Boolean) }
1514
1432
  def ==(other); end
@@ -1532,13 +1450,9 @@ class RBI::RBSPrinter < ::RBI::Visitor
1532
1450
  sig { void }
1533
1451
  def dedent; end
1534
1452
 
1535
- # @return [Boolean]
1536
1453
  def in_visibility_group; end
1537
-
1538
- # @return [Boolean]
1539
1454
  def in_visibility_group=(_arg0); end
1540
1455
 
1541
- # Printing
1542
1456
  sig { void }
1543
1457
  def indent; end
1544
1458
 
@@ -1548,13 +1462,11 @@ class RBI::RBSPrinter < ::RBI::Visitor
1548
1462
  sig { returns(T::Boolean) }
1549
1463
  def positional_names; end
1550
1464
 
1551
- # @return [Boolean]
1552
1465
  def positional_names=(_arg0); end
1553
1466
 
1554
1467
  sig { returns(T.nilable(::RBI::Node)) }
1555
1468
  def previous_node; end
1556
1469
 
1557
- # Print a string without indentation nor `\n` at the end.
1558
1470
  sig { params(string: ::String).void }
1559
1471
  def print(string); end
1560
1472
 
@@ -1564,7 +1476,6 @@ class RBI::RBSPrinter < ::RBI::Visitor
1564
1476
  sig { returns(T::Boolean) }
1565
1477
  def print_locs; end
1566
1478
 
1567
- # @return [Boolean]
1568
1479
  def print_locs=(_arg0); end
1569
1480
 
1570
1481
  sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void }
@@ -1576,15 +1487,12 @@ class RBI::RBSPrinter < ::RBI::Visitor
1576
1487
  sig { params(node: ::RBI::Method, sig: ::RBI::Sig).void }
1577
1488
  def print_method_sig_multiline(node, sig); end
1578
1489
 
1579
- # Print a string with indentation and `\n` at the end.
1580
1490
  sig { params(string: ::String).void }
1581
1491
  def printl(string); end
1582
1492
 
1583
- # Print a string without indentation but with a `\n` at the end.
1584
1493
  sig { params(string: T.nilable(::String)).void }
1585
1494
  def printn(string = T.unsafe(nil)); end
1586
1495
 
1587
- # Print a string with indentation but without a `\n` at the end.
1588
1496
  sig { params(string: T.nilable(::String)).void }
1589
1497
  def printt(string = T.unsafe(nil)); end
1590
1498
 
@@ -1746,9 +1654,6 @@ class RBI::RBSPrinter < ::RBI::Visitor
1746
1654
  sig { params(node: ::RBI::Node).returns(T::Boolean) }
1747
1655
  def oneline?(node); end
1748
1656
 
1749
- # Parse a string containing a `T.let(x, X)` and extract the type
1750
- #
1751
- # Returns `nil` is the string is not a `T.let`.
1752
1657
  sig { params(code: T.nilable(::String)).returns(T.nilable(::String)) }
1753
1658
  def parse_t_let(code); end
1754
1659
 
@@ -1866,7 +1771,6 @@ class RBI::Rewriters::AttrToMethods < ::RBI::Visitor
1866
1771
 
1867
1772
  private
1868
1773
 
1869
- # @raise [ReplaceNodeError]
1870
1774
  sig { params(node: ::RBI::Node, with: T::Array[::RBI::Node]).void }
1871
1775
  def replace(node, with:); end
1872
1776
  end
@@ -1884,57 +1788,6 @@ class RBI::Rewriters::Deannotate < ::RBI::Visitor
1884
1788
  def deannotate_node(node); end
1885
1789
  end
1886
1790
 
1887
- # Take a gem version and filter out all RBI that is not relevant to that version based on @version annotations
1888
- # in comments. As an example:
1889
- #
1890
- # ~~~rb
1891
- # tree = Parser.parse_string(<<~RBI)
1892
- # class Foo
1893
- # # @version > 0.3.0
1894
- # def bar
1895
- # end
1896
- #
1897
- # # @version <= 0.3.0
1898
- # def bar(arg1)
1899
- # end
1900
- # end
1901
- # RBI
1902
- #
1903
- # Rewriters::FilterVersions.filter(tree, Gem::Version.new("0.3.1"))
1904
- #
1905
- # assert_equal(<<~RBI, tree.string)
1906
- # class Foo
1907
- # # @version > 0.3.0
1908
- # def bar
1909
- # end
1910
- # end
1911
- # RBI
1912
- # ~~~
1913
- #
1914
- # Supported operators:
1915
- # - equals `=`
1916
- # - not equals `!=`
1917
- # - greater than `>`
1918
- # - greater than or equal to `>=`
1919
- # - less than `<`
1920
- # - less than or equal to `<=`
1921
- # - pessimistic or twiddle-wakka`~>`
1922
- #
1923
- # And/or logic:
1924
- # - "And" logic: put multiple versions on the same line
1925
- # - e.g. `@version > 0.3.0, <1.0.0` means version must be greater than 0.3.0 AND less than 1.0.0
1926
- # - "Or" logic: put multiple versions on subsequent lines
1927
- # - e.g. the following means version must be less than 0.3.0 OR greater than 1.0.0
1928
- # ```
1929
- # # @version < 0.3.0
1930
- # # @version > 1.0.0
1931
- # ```
1932
- # Prerelease versions:
1933
- # - Prerelease versions are considered less than their non-prerelease counterparts
1934
- # - e.g. `0.4.0-prerelease` is less than `0.4.0`
1935
- #
1936
- # RBI with no versions:
1937
- # - RBI with no version annotations are automatically counted towards ALL versions
1938
1791
  class RBI::Rewriters::FilterVersions < ::RBI::Visitor
1939
1792
  sig { params(version: ::Gem::Version).void }
1940
1793
  def initialize(version); end
@@ -1950,56 +1803,11 @@ end
1950
1803
 
1951
1804
  RBI::Rewriters::FilterVersions::VERSION_PREFIX = T.let(T.unsafe(nil), String)
1952
1805
 
1953
- # Rewrite non-singleton methods inside singleton classes to singleton methods
1954
- #
1955
- # Example:
1956
- # ~~~rb
1957
- # class << self
1958
- # def m1; end
1959
- # def self.m2; end
1960
- #
1961
- # class << self
1962
- # def m3; end
1963
- # end
1964
- # end
1965
- # ~~~
1966
- #
1967
- # will be rewritten to:
1968
- #
1969
- # ~~~rb
1970
- # def self.m1; end
1971
- #
1972
- # class << self
1973
- # def self.m2; end
1974
- # def self.m3; end
1975
- # end
1976
- # ~~~
1977
1806
  class RBI::Rewriters::FlattenSingletonMethods < ::RBI::Visitor
1978
1807
  sig { override.params(node: T.nilable(::RBI::Node)).void }
1979
1808
  def visit(node); end
1980
1809
  end
1981
1810
 
1982
- # Flattens visibility nodes into method nodes
1983
- #
1984
- # Example:
1985
- # ~~~rb
1986
- # class A
1987
- # def m1; end
1988
- # private
1989
- # def m2; end
1990
- # def m3; end
1991
- # end
1992
- # ~~~
1993
- #
1994
- # will be transformed into:
1995
- #
1996
- # ~~~rb
1997
- # class A
1998
- # def m1; end
1999
- # private def m2; end
2000
- # private def m3; end
2001
- # end
2002
- # ~~~
2003
1811
  class RBI::Rewriters::FlattenVisibilities < ::RBI::Visitor
2004
1812
  sig { void }
2005
1813
  def initialize; end
@@ -2018,39 +1826,6 @@ class RBI::Rewriters::GroupNodes < ::RBI::Visitor
2018
1826
  def group_kind(node); end
2019
1827
  end
2020
1828
 
2021
- # Merge two RBI trees together
2022
- #
2023
- # Be this `Tree`:
2024
- # ~~~rb
2025
- # class Foo
2026
- # attr_accessor :a
2027
- # def m; end
2028
- # C = 10
2029
- # end
2030
- # ~~~
2031
- #
2032
- # Merged with this one:
2033
- # ~~~rb
2034
- # class Foo
2035
- # attr_reader :a
2036
- # def m(x); end
2037
- # C = 10
2038
- # end
2039
- # ~~~
2040
- #
2041
- # Compatible definitions are merged together while incompatible definitions are moved into a `ConflictTree`:
2042
- # ~~~rb
2043
- # class Foo
2044
- # <<<<<<< left
2045
- # attr_accessor :a
2046
- # def m; end
2047
- # =======
2048
- # attr_reader :a
2049
- # def m(x); end
2050
- # >>>>>>> right
2051
- # C = 10
2052
- # end
2053
- # ~~~
2054
1829
  class RBI::Rewriters::Merge
2055
1830
  sig { params(left_name: ::String, right_name: ::String, keep: ::RBI::Rewriters::Merge::Keep).void }
2056
1831
  def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
@@ -2075,7 +1850,6 @@ class RBI::Rewriters::Merge
2075
1850
  end
2076
1851
  end
2077
1852
 
2078
- # Used for logging / error displaying purpose
2079
1853
  class RBI::Rewriters::Merge::Conflict
2080
1854
  sig { params(left: ::RBI::Node, right: ::RBI::Node, left_name: ::String, right_name: ::String).void }
2081
1855
  def initialize(left:, right:, left_name:, right_name:); end
@@ -2086,46 +1860,13 @@ class RBI::Rewriters::Merge::Conflict
2086
1860
  sig { returns(::String) }
2087
1861
  def left_name; end
2088
1862
 
2089
- # @return [Node]
2090
1863
  def right; end
2091
-
2092
- # @return [String]
2093
1864
  def right_name; end
2094
1865
 
2095
1866
  sig { returns(::String) }
2096
1867
  def to_s; end
2097
1868
  end
2098
1869
 
2099
- # Merge adjacent conflict trees
2100
- #
2101
- # Transform this:
2102
- # ~~~rb
2103
- # class Foo
2104
- # <<<<<<< left
2105
- # def m1; end
2106
- # =======
2107
- # def m1(a); end
2108
- # >>>>>>> right
2109
- # <<<<<<< left
2110
- # def m2(a); end
2111
- # =======
2112
- # def m2; end
2113
- # >>>>>>> right
2114
- # end
2115
- # ~~~
2116
- #
2117
- # Into this:
2118
- # ~~~rb
2119
- # class Foo
2120
- # <<<<<<< left
2121
- # def m1; end
2122
- # def m2(a); end
2123
- # =======
2124
- # def m1(a); end
2125
- # def m2; end
2126
- # >>>>>>> right
2127
- # end
2128
- # ~~~
2129
1870
  class RBI::Rewriters::Merge::ConflictTreeMerger < ::RBI::Visitor
2130
1871
  sig { override.params(node: T.nilable(::RBI::Node)).void }
2131
1872
  def visit(node); end
@@ -2147,13 +1888,8 @@ class RBI::Rewriters::Merge::Keep
2147
1888
  end
2148
1889
  end
2149
1890
 
2150
- # : Keep
2151
1891
  RBI::Rewriters::Merge::Keep::LEFT = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep)
2152
-
2153
- # : Keep
2154
1892
  RBI::Rewriters::Merge::Keep::NONE = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep)
2155
-
2156
- # : Keep
2157
1893
  RBI::Rewriters::Merge::Keep::RIGHT = T.let(T.unsafe(nil), RBI::Rewriters::Merge::Keep)
2158
1894
 
2159
1895
  class RBI::Rewriters::Merge::TreeMerger < ::RBI::Visitor
@@ -2201,22 +1937,6 @@ class RBI::Rewriters::NestSingletonMethods < ::RBI::Visitor
2201
1937
  def visit(node); end
2202
1938
  end
2203
1939
 
2204
- # This rewriter moves top-level members into a top-level Object class
2205
- #
2206
- # Example:
2207
- # ~~~rb
2208
- # def foo; end
2209
- # attr_reader :bar
2210
- # ~~~
2211
- #
2212
- # will be rewritten to:
2213
- #
2214
- # ~~~rb
2215
- # class Object
2216
- # def foo; end
2217
- # attr_reader :bar
2218
- # end
2219
- # ~~~
2220
1940
  class RBI::Rewriters::NestTopLevelMembers < ::RBI::Visitor
2221
1941
  sig { void }
2222
1942
  def initialize; end
@@ -2225,48 +1945,6 @@ class RBI::Rewriters::NestTopLevelMembers < ::RBI::Visitor
2225
1945
  def visit(node); end
2226
1946
  end
2227
1947
 
2228
- # Remove all definitions existing in the index from the current tree
2229
- #
2230
- # Let's create an `Index` from two different `Tree`s:
2231
- # ~~~rb
2232
- # tree1 = Parse.parse_string(<<~RBI)
2233
- # class Foo
2234
- # def foo; end
2235
- # end
2236
- # RBI
2237
- #
2238
- # tree2 = Parse.parse_string(<<~RBI)
2239
- # FOO = 10
2240
- # RBI
2241
- #
2242
- # index = Index.index(tree1, tree2)
2243
- # ~~~
2244
- #
2245
- # We can use `RemoveKnownDefinitions` to remove the definitions found in the `index` from the `Tree` to clean:
2246
- # ~~~rb
2247
- # tree_to_clean = Parser.parse_string(<<~RBI)
2248
- # class Foo
2249
- # def foo; end
2250
- # def bar; end
2251
- # end
2252
- # FOO = 10
2253
- # BAR = 42
2254
- # RBI
2255
- #
2256
- # cleaned_tree, operations = RemoveKnownDefinitions.remove(tree_to_clean, index)
2257
- #
2258
- # assert_equal(<<~RBI, cleaned_tree)
2259
- # class Foo
2260
- # def bar; end
2261
- # end
2262
- # BAR = 42
2263
- # RBI
2264
- #
2265
- # assert_equal(<<~OPERATIONS, operations.join("\n"))
2266
- # Deleted ::Foo#foo at -:2:2-2-16 (duplicate from -:2:2-2:16)
2267
- # Deleted ::FOO at -:5:0-5:8 (duplicate from -:1:0-1:8)
2268
- # OPERATIONS
2269
- # ~~~
2270
1948
  class RBI::Rewriters::RemoveKnownDefinitions < ::RBI::Visitor
2271
1949
  sig { params(index: ::RBI::Index).void }
2272
1950
  def initialize(index); end
@@ -2309,7 +1987,6 @@ class RBI::Rewriters::RemoveKnownDefinitions::Operation
2309
1987
  sig { returns(::RBI::Node) }
2310
1988
  def deleted_node; end
2311
1989
 
2312
- # @return [Node]
2313
1990
  def duplicate_of; end
2314
1991
 
2315
1992
  sig { returns(::String) }
@@ -2335,7 +2012,6 @@ class RBI::Rewriters::SortNodes < ::RBI::Visitor
2335
2012
  def sort_node_names!(node); end
2336
2013
  end
2337
2014
 
2338
- # Translate all RBS signature comments to Sorbet RBI signatures
2339
2015
  class RBI::Rewriters::TranslateRBSSigs < ::RBI::Visitor
2340
2016
  sig { override.params(node: T.nilable(::RBI::Node)).void }
2341
2017
  def visit(node); end
@@ -2354,15 +2030,14 @@ end
2354
2030
 
2355
2031
  class RBI::Rewriters::TranslateRBSSigs::Error < ::RBI::Error; end
2356
2032
 
2357
- # @abstract
2358
2033
  class RBI::Scope < ::RBI::Tree
2359
2034
  include ::RBI::Indexable
2360
2035
 
2361
- # Duplicate `self` scope without its body
2036
+ abstract!
2037
+
2362
2038
  sig { returns(T.self_type) }
2363
2039
  def dup_empty; end
2364
2040
 
2365
- # @abstract
2366
2041
  sig { abstract.returns(::String) }
2367
2042
  def fully_qualified_name; end
2368
2043
 
@@ -2373,18 +2048,6 @@ class RBI::Scope < ::RBI::Tree
2373
2048
  def to_s; end
2374
2049
  end
2375
2050
 
2376
- # A conflict between two scope headers
2377
- #
2378
- # Is rendered as a merge conflict between `left` and` right` for scope definitions:
2379
- # ~~~rb
2380
- # <<<<<<< left
2381
- # class Foo
2382
- # =======
2383
- # module Foo
2384
- # >>>>>>> right
2385
- # def m1; end
2386
- # end
2387
- # ~~~
2388
2051
  class RBI::ScopeConflict < ::RBI::Tree
2389
2052
  sig { params(left: ::RBI::Scope, right: ::RBI::Scope, left_name: ::String, right_name: ::String).void }
2390
2053
  def initialize(left:, right:, left_name: T.unsafe(nil), right_name: T.unsafe(nil)); end
@@ -2395,14 +2058,10 @@ class RBI::ScopeConflict < ::RBI::Tree
2395
2058
  sig { returns(::String) }
2396
2059
  def left_name; end
2397
2060
 
2398
- # @return [Scope]
2399
2061
  def right; end
2400
-
2401
- # @return [String]
2402
2062
  def right_name; end
2403
2063
  end
2404
2064
 
2405
- # Sends
2406
2065
  class RBI::Send < ::RBI::NodeWithComments
2407
2066
  include ::RBI::Indexable
2408
2067
 
@@ -2439,7 +2098,6 @@ class RBI::Send < ::RBI::NodeWithComments
2439
2098
  def to_s; end
2440
2099
  end
2441
2100
 
2442
- # Sorbet's sigs
2443
2101
  class RBI::Sig < ::RBI::NodeWithComments
2444
2102
  sig do
2445
2103
  params(
@@ -2450,6 +2108,7 @@ class RBI::Sig < ::RBI::NodeWithComments
2450
2108
  is_overridable: T::Boolean,
2451
2109
  is_final: T::Boolean,
2452
2110
  allow_incompatible_override: T::Boolean,
2111
+ allow_incompatible_override_visibility: T::Boolean,
2453
2112
  without_runtime: T::Boolean,
2454
2113
  type_params: T::Array[::String],
2455
2114
  checked: T.nilable(::Symbol),
@@ -2458,7 +2117,7 @@ class RBI::Sig < ::RBI::NodeWithComments
2458
2117
  block: T.nilable(T.proc.params(node: ::RBI::Sig).void)
2459
2118
  ).void
2460
2119
  end
2461
- def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), allow_incompatible_override: T.unsafe(nil), without_runtime: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2120
+ def initialize(params: T.unsafe(nil), return_type: T.unsafe(nil), is_abstract: T.unsafe(nil), is_override: T.unsafe(nil), is_overridable: T.unsafe(nil), is_final: T.unsafe(nil), allow_incompatible_override: T.unsafe(nil), allow_incompatible_override_visibility: T.unsafe(nil), without_runtime: T.unsafe(nil), type_params: T.unsafe(nil), checked: T.unsafe(nil), loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
2462
2121
 
2463
2122
  sig { params(param: ::RBI::SigParam).void }
2464
2123
  def <<(param); end
@@ -2469,40 +2128,39 @@ class RBI::Sig < ::RBI::NodeWithComments
2469
2128
  sig { params(name: ::String, type: T.any(::RBI::Type, ::String)).void }
2470
2129
  def add_param(name, type); end
2471
2130
 
2472
- # @return [Boolean]
2131
+ sig { returns(T::Boolean) }
2473
2132
  def allow_incompatible_override; end
2474
2133
 
2475
- # @return [Boolean]
2476
2134
  def allow_incompatible_override=(_arg0); end
2477
2135
 
2136
+ sig { returns(T::Boolean) }
2137
+ def allow_incompatible_override_visibility; end
2138
+
2139
+ def allow_incompatible_override_visibility=(_arg0); end
2140
+
2478
2141
  sig { returns(T.nilable(::Symbol)) }
2479
2142
  def checked; end
2480
2143
 
2481
- # @return [Symbol, nil]
2482
2144
  def checked=(_arg0); end
2483
2145
 
2484
2146
  sig { returns(T::Boolean) }
2485
2147
  def is_abstract; end
2486
2148
 
2487
- # @return [Boolean]
2488
2149
  def is_abstract=(_arg0); end
2489
2150
 
2490
- # @return [Boolean]
2151
+ sig { returns(T::Boolean) }
2491
2152
  def is_final; end
2492
2153
 
2493
- # @return [Boolean]
2494
2154
  def is_final=(_arg0); end
2495
2155
 
2496
- # @return [Boolean]
2156
+ sig { returns(T::Boolean) }
2497
2157
  def is_overridable; end
2498
2158
 
2499
- # @return [Boolean]
2500
2159
  def is_overridable=(_arg0); end
2501
2160
 
2502
- # @return [Boolean]
2161
+ sig { returns(T::Boolean) }
2503
2162
  def is_override; end
2504
2163
 
2505
- # @return [Boolean]
2506
2164
  def is_override=(_arg0); end
2507
2165
 
2508
2166
  sig { returns(T::Array[::RBI::SigParam]) }
@@ -2511,16 +2169,14 @@ class RBI::Sig < ::RBI::NodeWithComments
2511
2169
  sig { returns(T.any(::RBI::Type, ::String)) }
2512
2170
  def return_type; end
2513
2171
 
2514
- # @return [Type, String]
2515
2172
  def return_type=(_arg0); end
2516
2173
 
2517
2174
  sig { returns(T::Array[::String]) }
2518
2175
  def type_params; end
2519
2176
 
2520
- # @return [Boolean]
2177
+ sig { returns(T::Boolean) }
2521
2178
  def without_runtime; end
2522
2179
 
2523
- # @return [Boolean]
2524
2180
  def without_runtime=(_arg0); end
2525
2181
  end
2526
2182
 
@@ -2582,23 +2238,19 @@ class RBI::Struct < ::RBI::Scope
2582
2238
  sig { returns(T::Boolean) }
2583
2239
  def keyword_init; end
2584
2240
 
2585
- # @return [Boolean]
2586
2241
  def keyword_init=(_arg0); end
2587
2242
 
2588
2243
  sig { returns(T::Array[::Symbol]) }
2589
2244
  def members; end
2590
2245
 
2591
- # @return [Array<Symbol>]
2592
2246
  def members=(_arg0); end
2593
2247
 
2594
2248
  sig { returns(::String) }
2595
2249
  def name; end
2596
2250
 
2597
- # @return [String]
2598
2251
  def name=(_arg0); end
2599
2252
  end
2600
2253
 
2601
- # Sorbet's T::Enum
2602
2254
  class RBI::TEnum < ::RBI::Class
2603
2255
  sig do
2604
2256
  params(
@@ -2657,7 +2309,6 @@ class RBI::TEnumValue < ::RBI::NodeWithComments
2657
2309
  def to_s; end
2658
2310
  end
2659
2311
 
2660
- # Sorbet's T::Struct
2661
2312
  class RBI::TStruct < ::RBI::Class
2662
2313
  sig do
2663
2314
  params(
@@ -2698,8 +2349,9 @@ class RBI::TStructConst < ::RBI::TStructField
2698
2349
  def to_s; end
2699
2350
  end
2700
2351
 
2701
- # @abstract
2702
2352
  class RBI::TStructField < ::RBI::NodeWithComments
2353
+ abstract!
2354
+
2703
2355
  sig do
2704
2356
  params(
2705
2357
  name: ::String,
@@ -2717,23 +2369,19 @@ class RBI::TStructField < ::RBI::NodeWithComments
2717
2369
  sig { returns(T.nilable(::String)) }
2718
2370
  def default; end
2719
2371
 
2720
- # @return [String, nil]
2721
2372
  def default=(_arg0); end
2722
2373
 
2723
- # @abstract
2724
2374
  sig { abstract.returns(T::Array[::String]) }
2725
2375
  def fully_qualified_names; end
2726
2376
 
2727
2377
  sig { returns(::String) }
2728
2378
  def name; end
2729
2379
 
2730
- # @return [String]
2731
2380
  def name=(_arg0); end
2732
2381
 
2733
2382
  sig { returns(T.any(::RBI::Type, ::String)) }
2734
2383
  def type; end
2735
2384
 
2736
- # @return [Type, String]
2737
2385
  def type=(_arg0); end
2738
2386
  end
2739
2387
 
@@ -2897,14 +2545,12 @@ class RBI::Tree < ::RBI::NodeWithComments
2897
2545
  def nodes_cache; end
2898
2546
  end
2899
2547
 
2900
- # The base class for all RBI types.
2901
- #
2902
- # @abstract
2903
2548
  class RBI::Type
2549
+ abstract!
2550
+
2904
2551
  sig { void }
2905
2552
  def initialize; end
2906
2553
 
2907
- # @abstract
2908
2554
  sig { abstract.params(other: ::BasicObject).returns(T::Boolean) }
2909
2555
  def ==(other); end
2910
2556
 
@@ -2914,63 +2560,24 @@ class RBI::Type
2914
2560
  sig { override.returns(::Integer) }
2915
2561
  def hash; end
2916
2562
 
2917
- # Returns a new type that is `nilable` if it is not already.
2918
- #
2919
- # If the type is already nilable, it returns itself.
2920
- # ```ruby
2921
- # type = RBI::Type.simple("String")
2922
- # type.to_rbi # => "String"
2923
- # type.nilable.to_rbi # => "T.nilable(String)"
2924
- # type.nilable.nilable.to_rbi # => "T.nilable(String)"
2925
- # ```
2926
2563
  sig { returns(::RBI::Type) }
2927
2564
  def nilable; end
2928
2565
 
2929
- # Returns whether the type is nilable.
2930
2566
  sig { returns(T::Boolean) }
2931
2567
  def nilable?; end
2932
2568
 
2933
- # Returns the non-nilable version of the type.
2934
- # If the type is already non-nilable, it returns itself.
2935
- # If the type is nilable, it returns the inner type.
2936
- #
2937
- # ```ruby
2938
- # type = RBI::Type.nilable(RBI::Type.simple("String"))
2939
- # type.to_rbi # => "T.nilable(String)"
2940
- # type.non_nilable.to_rbi # => "String"
2941
- # type.non_nilable.non_nilable.to_rbi # => "String"
2942
- # ```
2943
2569
  sig { returns(::RBI::Type) }
2944
2570
  def non_nilable; end
2945
2571
 
2946
- # Returns a normalized version of the type.
2947
- #
2948
- # Normalized types are meant to be easier to process, not to read.
2949
- # For example, `T.any(TrueClass, FalseClass)` instead of `T::Boolean` or
2950
- # `T.any(String, NilClass)` instead of `T.nilable(String)`.
2951
- #
2952
- # This is the inverse of `#simplify`.
2953
- #
2954
- # @abstract
2955
2572
  sig { abstract.returns(::RBI::Type) }
2956
2573
  def normalize; end
2957
2574
 
2958
2575
  sig { returns(::String) }
2959
2576
  def rbs_string; end
2960
2577
 
2961
- # Returns a simplified version of the type.
2962
- #
2963
- # Simplified types are meant to be easier to read, not to process.
2964
- # For example, `T::Boolean` instead of `T.any(TrueClass, FalseClass)` or
2965
- # `T.nilable(String)` instead of `T.any(String, NilClass)`.
2966
- #
2967
- # This is the inverse of `#normalize`.
2968
- #
2969
- # @abstract
2970
2578
  sig { abstract.returns(::RBI::Type) }
2971
2579
  def simplify; end
2972
2580
 
2973
- # @abstract
2974
2581
  sig { abstract.returns(::String) }
2975
2582
  def to_rbi; end
2976
2583
 
@@ -2978,95 +2585,66 @@ class RBI::Type
2978
2585
  def to_s; end
2979
2586
 
2980
2587
  class << self
2981
- # Builds a type that represents an intersection of multiple types like `T.all(String, Integer)`.
2982
- #
2983
- # Note that this method transforms types such as `T.all(String, String)` into `String`, so
2984
- # it may return something other than a `All`.
2985
2588
  sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) }
2986
2589
  def all(type1, type2, *types); end
2987
2590
 
2988
- # Builds a type that represents a union of multiple types like `T.any(String, Integer)`.
2989
- #
2990
- # Note that this method transforms types such as `T.any(String, NilClass)` into `T.nilable(String)`, so
2991
- # it may return something other than a `Any`.
2992
2591
  sig { params(type1: ::RBI::Type, type2: ::RBI::Type, types: ::RBI::Type).returns(::RBI::Type) }
2993
2592
  def any(type1, type2, *types); end
2994
2593
 
2995
- # Builds a type that represents `T.anything`.
2996
2594
  sig { returns(::RBI::Type::Anything) }
2997
2595
  def anything; end
2998
2596
 
2999
- # Builds a type that represents `T.attached_class`.
3000
2597
  sig { returns(::RBI::Type::AttachedClass) }
3001
2598
  def attached_class; end
3002
2599
 
3003
- # Builds a type that represents `T::Boolean`.
3004
2600
  sig { returns(::RBI::Type::Boolean) }
3005
2601
  def boolean; end
3006
2602
 
3007
- # Builds a type that represents the singleton class of another type like `T.class_of(Foo)`.
3008
2603
  sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).returns(::RBI::Type::ClassOf) }
3009
2604
  def class_of(type, type_parameter = T.unsafe(nil)); end
3010
2605
 
3011
- # Builds a type that represents a generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`.
3012
2606
  sig { params(name: ::String, params: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Generic) }
3013
2607
  def generic(name, *params); end
3014
2608
 
3015
- # Builds a type that represents a nilable of another type like `T.nilable(String)`.
3016
- #
3017
- # Note that this method transforms types such as `T.nilable(T.untyped)` into `T.untyped`, so
3018
- # it may return something other than a `RBI::Type::Nilable`.
3019
2609
  sig { params(type: ::RBI::Type).returns(::RBI::Type) }
3020
2610
  def nilable(type); end
3021
2611
 
3022
- # Builds a type that represents `T.noreturn`.
3023
2612
  sig { returns(::RBI::Type::NoReturn) }
3024
2613
  def noreturn; end
3025
2614
 
3026
2615
  sig { params(node: ::Prism::Node).returns(::RBI::Type) }
3027
2616
  def parse_node(node); end
3028
2617
 
3029
- # @raise [Error]
3030
2618
  sig { params(string: ::String).returns(::RBI::Type) }
3031
2619
  def parse_string(string); end
3032
2620
 
3033
- # Builds a type that represents a proc type like `T.proc.void`.
3034
2621
  sig { returns(::RBI::Type::Proc) }
3035
2622
  def proc; end
3036
2623
 
3037
- # Builds a type that represents `T.self_type`.
3038
2624
  sig { returns(::RBI::Type::SelfType) }
3039
2625
  def self_type; end
3040
2626
 
3041
- # Builds a type that represents a shape type like `{name: String, age: Integer}`.
3042
2627
  sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).returns(::RBI::Type::Shape) }
3043
2628
  def shape(types = T.unsafe(nil)); end
3044
2629
 
3045
- # Builds a simple type like `String` or `::Foo::Bar`.
3046
- #
3047
- # It raises a `NameError` if the name is not a valid Ruby class identifier.
3048
- #
3049
- # @raise [NameError]
3050
2630
  sig { params(name: ::String).returns(::RBI::Type::Simple) }
3051
2631
  def simple(name); end
3052
2632
 
3053
- # Builds a type that represents the class of another type like `T::Class[Foo]`.
3054
2633
  sig { params(type: ::RBI::Type).returns(::RBI::Type::Class) }
3055
2634
  def t_class(type); end
3056
2635
 
3057
- # Builds a type that represents a tuple type like `[String, Integer]`.
3058
2636
  sig { params(types: T.any(::RBI::Type, T::Array[::RBI::Type])).returns(::RBI::Type::Tuple) }
3059
2637
  def tuple(*types); end
3060
2638
 
3061
- # Builds a type that represents a type parameter like `T.type_parameter(:U)`.
2639
+ sig { params(name: ::String, aliased_type: ::RBI::Type).returns(::RBI::Type::TypeAlias) }
2640
+ def type_alias(name, aliased_type); end
2641
+
3062
2642
  sig { params(name: ::Symbol).returns(::RBI::Type::TypeParameter) }
3063
2643
  def type_parameter(name); end
3064
2644
 
3065
- # Builds a type that represents `T.untyped`.
3066
2645
  sig { returns(::RBI::Type::Untyped) }
3067
2646
  def untyped; end
3068
2647
 
3069
- # Builds a type that represents `void`.
3070
2648
  sig { returns(::RBI::Type::Void) }
3071
2649
  def void; end
3072
2650
 
@@ -3081,14 +2659,15 @@ class RBI::Type
3081
2659
  sig { params(node: ::Prism::CallNode, count: ::Integer).returns(T::Array[::Prism::Node]) }
3082
2660
  def check_arguments_exactly!(node, count); end
3083
2661
 
3084
- # @raise [Error]
3085
2662
  sig { params(node: ::Prism::CallNode).returns(::RBI::Type) }
3086
2663
  def parse_call(node); end
3087
2664
 
3088
2665
  sig { params(node: T.any(::Prism::ConstantPathNode, ::Prism::ConstantReadNode)).returns(::RBI::Type) }
3089
2666
  def parse_constant(node); end
3090
2667
 
3091
- # @raise [Error]
2668
+ sig { params(node: T.any(::Prism::ConstantPathWriteNode, ::Prism::ConstantWriteNode)).returns(::RBI::Type) }
2669
+ def parse_constant_assignment(node); end
2670
+
3092
2671
  sig { params(node: ::Prism::CallNode).returns(::RBI::Type) }
3093
2672
  def parse_proc(node); end
3094
2673
 
@@ -3113,12 +2692,14 @@ class RBI::Type
3113
2692
  sig { params(node: ::Prism::CallNode).returns(T::Boolean) }
3114
2693
  def t_proc?(node); end
3115
2694
 
2695
+ sig { params(node: T.nilable(::Prism::Node)).returns(T::Boolean) }
2696
+ def t_type_alias?(node); end
2697
+
3116
2698
  sig { params(name: ::String).returns(T::Boolean) }
3117
2699
  def valid_identifier?(name); end
3118
2700
  end
3119
2701
  end
3120
2702
 
3121
- # A type that is intersection of multiple types like `T.all(String, Integer)`.
3122
2703
  class RBI::Type::All < ::RBI::Type::Composite
3123
2704
  sig { override.returns(::RBI::Type) }
3124
2705
  def normalize; end
@@ -3130,7 +2711,6 @@ class RBI::Type::All < ::RBI::Type::Composite
3130
2711
  def to_rbi; end
3131
2712
  end
3132
2713
 
3133
- # A type that is union of multiple types like `T.any(String, Integer)`.
3134
2714
  class RBI::Type::Any < ::RBI::Type::Composite
3135
2715
  sig { returns(T::Boolean) }
3136
2716
  def nilable?; end
@@ -3145,7 +2725,6 @@ class RBI::Type::Any < ::RBI::Type::Composite
3145
2725
  def to_rbi; end
3146
2726
  end
3147
2727
 
3148
- # `T.anything`.
3149
2728
  class RBI::Type::Anything < ::RBI::Type
3150
2729
  sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3151
2730
  def ==(other); end
@@ -3160,7 +2739,6 @@ class RBI::Type::Anything < ::RBI::Type
3160
2739
  def to_rbi; end
3161
2740
  end
3162
2741
 
3163
- # `T.attached_class`.
3164
2742
  class RBI::Type::AttachedClass < ::RBI::Type
3165
2743
  sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3166
2744
  def ==(other); end
@@ -3175,7 +2753,6 @@ class RBI::Type::AttachedClass < ::RBI::Type
3175
2753
  def to_rbi; end
3176
2754
  end
3177
2755
 
3178
- # `T::Boolean`.
3179
2756
  class RBI::Type::Boolean < ::RBI::Type
3180
2757
  sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3181
2758
  def ==(other); end
@@ -3190,7 +2767,6 @@ class RBI::Type::Boolean < ::RBI::Type
3190
2767
  def to_rbi; end
3191
2768
  end
3192
2769
 
3193
- # The class of another type like `T::Class[Foo]`.
3194
2770
  class RBI::Type::Class < ::RBI::Type
3195
2771
  sig { params(type: ::RBI::Type).void }
3196
2772
  def initialize(type); end
@@ -3211,7 +2787,6 @@ class RBI::Type::Class < ::RBI::Type
3211
2787
  def type; end
3212
2788
  end
3213
2789
 
3214
- # The singleton class of another type like `T.class_of(Foo)`.
3215
2790
  class RBI::Type::ClassOf < ::RBI::Type
3216
2791
  sig { params(type: ::RBI::Type::Simple, type_parameter: T.nilable(::RBI::Type)).void }
3217
2792
  def initialize(type, type_parameter = T.unsafe(nil)); end
@@ -3235,10 +2810,9 @@ class RBI::Type::ClassOf < ::RBI::Type
3235
2810
  def type_parameter; end
3236
2811
  end
3237
2812
 
3238
- # A type that is composed of multiple types like `T.all(String, Integer)`.
3239
- #
3240
- # @abstract
3241
2813
  class RBI::Type::Composite < ::RBI::Type
2814
+ abstract!
2815
+
3242
2816
  sig { params(types: T::Array[::RBI::Type]).void }
3243
2817
  def initialize(types); end
3244
2818
 
@@ -3251,7 +2825,6 @@ end
3251
2825
 
3252
2826
  class RBI::Type::Error < ::RBI::Error; end
3253
2827
 
3254
- # A generic type like `T::Array[String]` or `T::Hash[Symbol, Integer]`.
3255
2828
  class RBI::Type::Generic < ::RBI::Type
3256
2829
  sig { params(name: ::String, params: ::RBI::Type).void }
3257
2830
  def initialize(name, *params); end
@@ -3275,7 +2848,6 @@ class RBI::Type::Generic < ::RBI::Type
3275
2848
  def to_rbi; end
3276
2849
  end
3277
2850
 
3278
- # A type that can be `nil` like `T.nilable(String)`.
3279
2851
  class RBI::Type::Nilable < ::RBI::Type
3280
2852
  sig { params(type: ::RBI::Type).void }
3281
2853
  def initialize(type); end
@@ -3296,7 +2868,6 @@ class RBI::Type::Nilable < ::RBI::Type
3296
2868
  def type; end
3297
2869
  end
3298
2870
 
3299
- # `T.noreturn`.
3300
2871
  class RBI::Type::NoReturn < ::RBI::Type
3301
2872
  sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3302
2873
  def ==(other); end
@@ -3311,7 +2882,6 @@ class RBI::Type::NoReturn < ::RBI::Type
3311
2882
  def to_rbi; end
3312
2883
  end
3313
2884
 
3314
- # A proc type like `T.proc.void`.
3315
2885
  class RBI::Type::Proc < ::RBI::Type
3316
2886
  sig { void }
3317
2887
  def initialize; end
@@ -3350,7 +2920,6 @@ class RBI::Type::Proc < ::RBI::Type
3350
2920
  def void; end
3351
2921
  end
3352
2922
 
3353
- # `T.self_type`.
3354
2923
  class RBI::Type::SelfType < ::RBI::Type
3355
2924
  sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3356
2925
  def ==(other); end
@@ -3365,7 +2934,6 @@ class RBI::Type::SelfType < ::RBI::Type
3365
2934
  def to_rbi; end
3366
2935
  end
3367
2936
 
3368
- # A shape type like `{name: String, age: Integer}`.
3369
2937
  class RBI::Type::Shape < ::RBI::Type
3370
2938
  sig { params(types: T::Hash[T.any(::String, ::Symbol), ::RBI::Type]).void }
3371
2939
  def initialize(types); end
@@ -3386,9 +2954,6 @@ class RBI::Type::Shape < ::RBI::Type
3386
2954
  def types; end
3387
2955
  end
3388
2956
 
3389
- # A type that represents a simple class name like `String` or `Foo`.
3390
- #
3391
- # It can also be a qualified name like `::Foo` or `Foo::Bar`.
3392
2957
  class RBI::Type::Simple < ::RBI::Type
3393
2958
  sig { params(name: ::String).void }
3394
2959
  def initialize(name); end
@@ -3409,7 +2974,6 @@ class RBI::Type::Simple < ::RBI::Type
3409
2974
  def to_rbi; end
3410
2975
  end
3411
2976
 
3412
- # A tuple type like `[String, Integer]`.
3413
2977
  class RBI::Type::Tuple < ::RBI::Type
3414
2978
  sig { params(types: T::Array[::RBI::Type]).void }
3415
2979
  def initialize(types); end
@@ -3430,7 +2994,29 @@ class RBI::Type::Tuple < ::RBI::Type
3430
2994
  def types; end
3431
2995
  end
3432
2996
 
3433
- # A type parameter like `T.type_parameter(:U)`.
2997
+ class RBI::Type::TypeAlias < ::RBI::Type
2998
+ sig { params(name: ::String, aliased_type: ::RBI::Type).void }
2999
+ def initialize(name, aliased_type); end
3000
+
3001
+ sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3002
+ def ==(other); end
3003
+
3004
+ sig { returns(::RBI::Type) }
3005
+ def aliased_type; end
3006
+
3007
+ sig { returns(::String) }
3008
+ def name; end
3009
+
3010
+ sig { override.returns(::RBI::Type) }
3011
+ def normalize; end
3012
+
3013
+ sig { override.returns(::RBI::Type) }
3014
+ def simplify; end
3015
+
3016
+ sig { override.returns(::String) }
3017
+ def to_rbi; end
3018
+ end
3019
+
3434
3020
  class RBI::Type::TypeParameter < ::RBI::Type
3435
3021
  sig { params(name: ::Symbol).void }
3436
3022
  def initialize(name); end
@@ -3451,7 +3037,6 @@ class RBI::Type::TypeParameter < ::RBI::Type
3451
3037
  def to_rbi; end
3452
3038
  end
3453
3039
 
3454
- # `T.untyped`.
3455
3040
  class RBI::Type::Untyped < ::RBI::Type
3456
3041
  sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3457
3042
  def ==(other); end
@@ -3517,6 +3102,9 @@ class RBI::Type::Visitor
3517
3102
  sig { params(type: ::RBI::Type::Tuple).void }
3518
3103
  def visit_tuple(type); end
3519
3104
 
3105
+ sig { params(type: ::RBI::Type::TypeAlias).void }
3106
+ def visit_type_alias(type); end
3107
+
3520
3108
  sig { params(type: ::RBI::Type::TypeParameter).void }
3521
3109
  def visit_type_parameter(type); end
3522
3110
 
@@ -3529,7 +3117,6 @@ end
3529
3117
 
3530
3118
  class RBI::Type::Visitor::Error < ::RBI::Error; end
3531
3119
 
3532
- # `void`.
3533
3120
  class RBI::Type::Void < ::RBI::Type
3534
3121
  sig { override.params(other: ::BasicObject).returns(T::Boolean) }
3535
3122
  def ==(other); end
@@ -3570,7 +3157,6 @@ class RBI::TypeMember < ::RBI::NodeWithComments
3570
3157
  sig { override.returns(::String) }
3571
3158
  def to_s; end
3572
3159
 
3573
- # @return [String]
3574
3160
  def value; end
3575
3161
  end
3576
3162
 
@@ -3665,8 +3251,9 @@ end
3665
3251
 
3666
3252
  RBI::VERSION = T.let(T.unsafe(nil), String)
3667
3253
 
3668
- # @abstract
3669
3254
  class RBI::Visibility < ::RBI::NodeWithComments
3255
+ abstract!
3256
+
3670
3257
  sig { params(visibility: ::Symbol, loc: T.nilable(::RBI::Loc), comments: T::Array[::RBI::Comment]).void }
3671
3258
  def initialize(visibility, loc: T.unsafe(nil), comments: T.unsafe(nil)); end
3672
3259
 
@@ -3694,8 +3281,9 @@ class RBI::VisibilityGroup < ::RBI::Tree
3694
3281
  def visibility; end
3695
3282
  end
3696
3283
 
3697
- # @abstract
3698
3284
  class RBI::Visitor
3285
+ abstract!
3286
+
3699
3287
  sig { params(node: T.nilable(::RBI::Node)).void }
3700
3288
  def visit(node); end
3701
3289