rbs 3.8.0 → 3.9.0.dev.1
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.
- checksums.yaml +4 -4
- data/.github/workflows/comments.yml +3 -3
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/ruby.yml +7 -7
- data/.github/workflows/typecheck.yml +2 -0
- data/.github/workflows/windows.yml +15 -0
- data/.rubocop.yml +20 -1
- data/CHANGELOG.md +14 -0
- data/Rakefile +5 -2
- data/config.yml +6 -0
- data/core/data.rbs +1 -1
- data/core/enumerator.rbs +14 -2
- data/core/exception.rbs +148 -39
- data/core/gc.rbs +2 -2
- data/core/io.rbs +7 -3
- data/core/kernel.rbs +58 -16
- data/core/method.rbs +2 -2
- data/core/module.rbs +3 -3
- data/core/proc.rbs +2 -2
- data/core/ractor.rbs +4 -1
- data/core/rbs/unnamed/argf.rbs +3 -3
- data/core/regexp.rbs +4 -2
- data/core/ruby_vm.rbs +8 -8
- data/core/rubygems/version.rbs +2 -2
- data/core/string.rbs +1 -1
- data/core/time.rbs +1 -1
- data/core/unbound_method.rbs +1 -1
- data/docs/syntax.md +10 -5
- data/ext/rbs_extension/extconf.rb +2 -1
- data/ext/rbs_extension/location.c +32 -10
- data/ext/rbs_extension/location.h +4 -3
- data/ext/rbs_extension/main.c +22 -1
- data/ext/rbs_extension/parser.c +144 -136
- data/ext/rbs_extension/parserstate.c +40 -9
- data/ext/rbs_extension/parserstate.h +6 -4
- data/include/rbs/ruby_objs.h +6 -6
- data/include/rbs/util/rbs_constant_pool.h +219 -0
- data/lib/rbs/ast/declarations.rb +9 -4
- data/lib/rbs/ast/directives.rb +10 -0
- data/lib/rbs/ast/members.rb +2 -0
- data/lib/rbs/ast/type_param.rb +2 -2
- data/lib/rbs/cli/validate.rb +1 -0
- data/lib/rbs/cli.rb +3 -3
- data/lib/rbs/collection/config/lockfile_generator.rb +28 -7
- data/lib/rbs/collection/sources/rubygems.rb +1 -1
- data/lib/rbs/definition.rb +46 -31
- data/lib/rbs/definition_builder/ancestor_builder.rb +2 -0
- data/lib/rbs/definition_builder.rb +86 -30
- data/lib/rbs/environment.rb +33 -18
- data/lib/rbs/errors.rb +23 -0
- data/lib/rbs/locator.rb +2 -0
- data/lib/rbs/method_type.rb +2 -0
- data/lib/rbs/parser_aux.rb +38 -1
- data/lib/rbs/subtractor.rb +3 -3
- data/lib/rbs/test/hook.rb +2 -2
- data/lib/rbs/test/type_check.rb +7 -5
- data/lib/rbs/types.rb +44 -5
- data/lib/rbs/unit_test/spy.rb +4 -2
- data/lib/rbs/unit_test/type_assertions.rb +17 -11
- data/lib/rbs/validator.rb +4 -0
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +10 -5
- data/lib/rbs.rb +1 -0
- data/rbs.gemspec +1 -1
- data/sig/collection/config/lockfile_generator.rbs +1 -1
- data/sig/declarations.rbs +10 -3
- data/sig/definition.rbs +67 -14
- data/sig/definition_builder.rbs +17 -3
- data/sig/directives.rbs +17 -1
- data/sig/environment.rbs +2 -0
- data/sig/errors.rbs +16 -0
- data/sig/parser.rbs +5 -1
- data/sig/subtractor.rbs +1 -1
- data/sig/test/type_check.rbs +2 -2
- data/sig/type_param.rbs +1 -1
- data/sig/types.rbs +3 -0
- data/sig/unit_test/spy.rbs +2 -0
- data/sig/unit_test/type_assertions.rbs +2 -0
- data/sig/validator.rbs +4 -0
- data/sig/writer.rbs +1 -1
- data/src/ruby_objs.c +12 -6
- data/src/util/rbs_constant_pool.c +342 -0
- data/stdlib/cgi/0/core.rbs +10 -0
- data/stdlib/json/0/json.rbs +52 -50
- data/stdlib/monitor/0/monitor.rbs +13 -4
- data/stdlib/net-http/0/net-http.rbs +2 -2
- data/stdlib/openssl/0/openssl.rbs +73 -73
- data/stdlib/resolv/0/resolv.rbs +8 -8
- data/stdlib/socket/0/addrinfo.rbs +1 -1
- data/stdlib/socket/0/unix_socket.rbs +4 -2
- data/stdlib/stringio/0/stringio.rbs +1 -1
- data/stdlib/uri/0/common.rbs +17 -0
- metadata +4 -7
- data/templates/include/rbs/constants.h.erb +0 -20
- data/templates/include/rbs/ruby_objs.h.erb +0 -10
- data/templates/src/constants.c.erb +0 -36
- data/templates/src/ruby_objs.c.erb +0 -27
- data/templates/template.rb +0 -122
    
        data/stdlib/json/0/json.rbs
    CHANGED
    
    | @@ -2,26 +2,6 @@ interface _ToJson | |
| 2 2 | 
             
              def to_json: (?JSON::State state) -> String
         | 
| 3 3 | 
             
            end
         | 
| 4 4 |  | 
| 5 | 
            -
            interface _JsonToWritableIO
         | 
| 6 | 
            -
              def to_io: () -> _JsonWrite
         | 
| 7 | 
            -
            end
         | 
| 8 | 
            -
             | 
| 9 | 
            -
            interface _JsonWrite
         | 
| 10 | 
            -
              def write: (String json) -> void
         | 
| 11 | 
            -
             | 
| 12 | 
            -
              def flush: () -> void
         | 
| 13 | 
            -
            end
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            interface _JsonReadableIO
         | 
| 16 | 
            -
              def to_io: () -> _JsonRead
         | 
| 17 | 
            -
            end
         | 
| 18 | 
            -
             | 
| 19 | 
            -
            interface _JsonRead
         | 
| 20 | 
            -
              def read: () -> string
         | 
| 21 | 
            -
            end
         | 
| 22 | 
            -
             | 
| 23 | 
            -
            type json_options = Hash[Symbol, untyped]
         | 
| 24 | 
            -
             | 
| 25 5 | 
             
            # <!-- rdoc-file=ext/json/lib/json/common.rb -->
         | 
| 26 6 | 
             
            # The base exception for JSON errors.
         | 
| 27 7 | 
             
            #
         | 
| @@ -96,10 +76,6 @@ end | |
| 96 76 | 
             
            class JSON::Pure::Parser
         | 
| 97 77 | 
             
            end
         | 
| 98 78 |  | 
| 99 | 
            -
            type json_generator = singleton(::JSON::Ext::Generator) | singleton(::JSON::Pure::Generator)
         | 
| 100 | 
            -
            type json_parser = singleton(::JSON::Ext::Parser) | singleton(::JSON::Pure::Parser)
         | 
| 101 | 
            -
            type json_state = singleton(JSON::Ext::Generator::State) | singleton(JSON::Pure::Generator::State)
         | 
| 102 | 
            -
             | 
| 103 79 | 
             
            # <!-- rdoc-file=ext/json/lib/json.rb -->
         | 
| 104 80 | 
             
            # # JavaScript Object Notation (JSON)
         | 
| 105 81 | 
             
            #
         | 
| @@ -675,6 +651,32 @@ type json_state = singleton(JSON::Ext::Generator::State) | singleton(JSON::Pure: | |
| 675 651 | 
             
            #       With custom addition:     #<Foo:0x0000000006473bb8 @bar=0, @baz=1> (Foo)
         | 
| 676 652 | 
             
            #
         | 
| 677 653 | 
             
            module JSON
         | 
| 654 | 
            +
              type options = Hash[Symbol, untyped]
         | 
| 655 | 
            +
             | 
| 656 | 
            +
              type generator = singleton(::JSON::Ext::Generator) | singleton(::JSON::Pure::Generator)
         | 
| 657 | 
            +
             | 
| 658 | 
            +
              type parser = singleton(::JSON::Ext::Parser) | singleton(::JSON::Pure::Parser)
         | 
| 659 | 
            +
             | 
| 660 | 
            +
              type state = singleton(JSON::Ext::Generator::State) | singleton(JSON::Pure::Generator::State)
         | 
| 661 | 
            +
             | 
| 662 | 
            +
              interface _WritableIO
         | 
| 663 | 
            +
                def to_io: () -> _Write
         | 
| 664 | 
            +
              end
         | 
| 665 | 
            +
             | 
| 666 | 
            +
              interface _Write
         | 
| 667 | 
            +
                def write: (String json) -> void
         | 
| 668 | 
            +
             | 
| 669 | 
            +
                def flush: () -> void
         | 
| 670 | 
            +
              end
         | 
| 671 | 
            +
             | 
| 672 | 
            +
              interface _ReadableIO
         | 
| 673 | 
            +
                def to_io: () -> _Read
         | 
| 674 | 
            +
              end
         | 
| 675 | 
            +
             | 
| 676 | 
            +
              interface _Read
         | 
| 677 | 
            +
                def read: () -> string
         | 
| 678 | 
            +
              end
         | 
| 679 | 
            +
             | 
| 678 680 | 
             
              # <!--
         | 
| 679 681 | 
             
              #   rdoc-file=ext/json/lib/json/common.rb
         | 
| 680 682 | 
             
              #   - JSON[object] -> new_array or new_string
         | 
| @@ -689,7 +691,7 @@ module JSON | |
| 689 691 | 
             
              #     ruby = [0, 1, nil]
         | 
| 690 692 | 
             
              #     JSON[ruby] # => '[0,1,null]'
         | 
| 691 693 | 
             
              #
         | 
| 692 | 
            -
              def self.[]: (untyped object, ? | 
| 694 | 
            +
              def self.[]: (untyped object, ?options opts) -> untyped
         | 
| 693 695 |  | 
| 694 696 | 
             
              # <!--
         | 
| 695 697 | 
             
              #   rdoc-file=ext/json/lib/json/common.rb
         | 
| @@ -744,22 +746,22 @@ module JSON | |
| 744 746 | 
             
              #     {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"}
         | 
| 745 747 | 
             
              #
         | 
| 746 748 | 
             
              def self?.dump: (_ToJson obj, ?Integer limit) -> String
         | 
| 747 | 
            -
                            | (_ToJson obj,  | 
| 748 | 
            -
                            | (_ToJson obj,  | 
| 749 | 
            +
                            | (_ToJson obj, _WritableIO anIO) -> _Write
         | 
| 750 | 
            +
                            | (_ToJson obj, _Write anIO, ?Integer limit) -> _Write
         | 
| 749 751 |  | 
| 750 752 | 
             
              # <!-- rdoc-file=ext/json/lib/json/common.rb -->
         | 
| 751 753 | 
             
              # Sets or returns the default options for the JSON.dump method. Initially:
         | 
| 752 754 | 
             
              #     opts = JSON.dump_default_options
         | 
| 753 755 | 
             
              #     opts # => {:max_nesting=>false, :allow_nan=>true}
         | 
| 754 756 | 
             
              #
         | 
| 755 | 
            -
              def self.dump_default_options: () ->  | 
| 757 | 
            +
              def self.dump_default_options: () -> options
         | 
| 756 758 |  | 
| 757 759 | 
             
              # <!-- rdoc-file=ext/json/lib/json/common.rb -->
         | 
| 758 760 | 
             
              # Sets or returns the default options for the JSON.dump method. Initially:
         | 
| 759 761 | 
             
              #     opts = JSON.dump_default_options
         | 
| 760 762 | 
             
              #     opts # => {:max_nesting=>false, :allow_nan=>true}
         | 
| 761 763 | 
             
              #
         | 
| 762 | 
            -
              def self.dump_default_options=: ( | 
| 764 | 
            +
              def self.dump_default_options=: (options) -> options
         | 
| 763 765 |  | 
| 764 766 | 
             
              # <!--
         | 
| 765 767 | 
             
              #   rdoc-file=ext/json/lib/json/common.rb
         | 
| @@ -776,7 +778,7 @@ module JSON | |
| 776 778 | 
             
              #     # Raises SystemStackError (stack level too deep):
         | 
| 777 779 | 
             
              #     JSON.fast_generate(a)
         | 
| 778 780 | 
             
              #
         | 
| 779 | 
            -
              def self?.fast_generate: (_ToJson obj, ? | 
| 781 | 
            +
              def self?.fast_generate: (_ToJson obj, ?options opts) -> String
         | 
| 780 782 |  | 
| 781 783 | 
             
              alias self.fast_unparse self.fast_generate
         | 
| 782 784 |  | 
| @@ -819,14 +821,14 @@ module JSON | |
| 819 821 | 
             
              #     # Raises JSON::NestingError (nesting of 100 is too deep):
         | 
| 820 822 | 
             
              #     JSON.generate(a)
         | 
| 821 823 | 
             
              #
         | 
| 822 | 
            -
              def self?.generate: (_ToJson obj, ? | 
| 824 | 
            +
              def self?.generate: (_ToJson obj, ?options opts) -> String
         | 
| 823 825 |  | 
| 824 826 | 
             
              # <!-- rdoc-file=ext/json/lib/json/common.rb -->
         | 
| 825 827 | 
             
              # Returns the JSON generator module that is used by JSON.
         | 
| 826 828 | 
             
              #
         | 
| 827 | 
            -
              def self.generator: () ->  | 
| 829 | 
            +
              def self.generator: () -> generator
         | 
| 828 830 |  | 
| 829 | 
            -
              def self.generator=: ( | 
| 831 | 
            +
              def self.generator=: (generator generator) -> void
         | 
| 830 832 |  | 
| 831 833 | 
             
              # <!--
         | 
| 832 834 | 
             
              #   rdoc-file=ext/json/lib/json/common.rb
         | 
| @@ -972,7 +974,7 @@ module JSON | |
| 972 974 | 
             
              #        #<Admin:0x00000000064c41f8
         | 
| 973 975 | 
             
              #        @attributes={"type"=>"Admin", "password"=>"0wn3d"}>}
         | 
| 974 976 | 
             
              #
         | 
| 975 | 
            -
              def self?.load: (string |  | 
| 977 | 
            +
              def self?.load: (string | _ReadableIO | _Read source, ?Proc proc, ?options options) -> untyped
         | 
| 976 978 |  | 
| 977 979 | 
             
              # <!--
         | 
| 978 980 | 
             
              #   rdoc-file=ext/json/lib/json/common.rb
         | 
| @@ -983,7 +985,7 @@ module JSON | |
| 983 985 | 
             
              #
         | 
| 984 986 | 
             
              # See method #parse.
         | 
| 985 987 | 
             
              #
         | 
| 986 | 
            -
              def self?.load_file: (string path, ? | 
| 988 | 
            +
              def self?.load_file: (string path, ?options opts) -> untyped
         | 
| 987 989 |  | 
| 988 990 | 
             
              # <!--
         | 
| 989 991 | 
             
              #   rdoc-file=ext/json/lib/json/common.rb
         | 
| @@ -994,21 +996,21 @@ module JSON | |
| 994 996 | 
             
              #
         | 
| 995 997 | 
             
              # See method #parse!
         | 
| 996 998 | 
             
              #
         | 
| 997 | 
            -
              def self?.load_file!: (string path, ? | 
| 999 | 
            +
              def self?.load_file!: (string path, ?options opts) -> untyped
         | 
| 998 1000 |  | 
| 999 1001 | 
             
              # <!-- rdoc-file=ext/json/lib/json/common.rb -->
         | 
| 1000 1002 | 
             
              # Sets or returns default options for the JSON.load method. Initially:
         | 
| 1001 1003 | 
             
              #     opts = JSON.load_default_options
         | 
| 1002 1004 | 
             
              #     opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
         | 
| 1003 1005 | 
             
              #
         | 
| 1004 | 
            -
              def self.load_default_options: () ->  | 
| 1006 | 
            +
              def self.load_default_options: () -> options
         | 
| 1005 1007 |  | 
| 1006 1008 | 
             
              # <!-- rdoc-file=ext/json/lib/json/common.rb -->
         | 
| 1007 1009 | 
             
              # Sets or returns default options for the JSON.load method. Initially:
         | 
| 1008 1010 | 
             
              #     opts = JSON.load_default_options
         | 
| 1009 1011 | 
             
              #     opts # => {:max_nesting=>false, :allow_nan=>true, :allow_blank=>true, :create_additions=>true}
         | 
| 1010 1012 | 
             
              #
         | 
| 1011 | 
            -
              def self.load_default_options=: ( | 
| 1013 | 
            +
              def self.load_default_options=: (options) -> options
         | 
| 1012 1014 |  | 
| 1013 1015 | 
             
              # <!--
         | 
| 1014 1016 | 
             
              #   rdoc-file=ext/json/lib/json/common.rb
         | 
| @@ -1059,7 +1061,7 @@ module JSON | |
| 1059 1061 | 
             
              #     # Raises JSON::ParserError (783: unexpected token at ''):
         | 
| 1060 1062 | 
             
              #     JSON.parse('')
         | 
| 1061 1063 | 
             
              #
         | 
| 1062 | 
            -
              def self?.parse: (string source, ? | 
| 1064 | 
            +
              def self?.parse: (string source, ?options opts) -> untyped
         | 
| 1063 1065 |  | 
| 1064 1066 | 
             
              # <!--
         | 
| 1065 1067 | 
             
              #   rdoc-file=ext/json/lib/json/common.rb
         | 
| @@ -1075,14 +1077,14 @@ module JSON | |
| 1075 1077 | 
             
              #     checking for nesting depth.
         | 
| 1076 1078 | 
             
              # *   Option `allow_nan`, if not provided, defaults to `true`.
         | 
| 1077 1079 | 
             
              #
         | 
| 1078 | 
            -
              def self?.parse!: (string source, ? | 
| 1080 | 
            +
              def self?.parse!: (string source, ?options opts) -> untyped
         | 
| 1079 1081 |  | 
| 1080 1082 | 
             
              # <!-- rdoc-file=ext/json/lib/json/common.rb -->
         | 
| 1081 1083 | 
             
              # Returns the JSON parser class that is used by JSON.
         | 
| 1082 1084 | 
             
              #
         | 
| 1083 | 
            -
              def self.parser: () ->  | 
| 1085 | 
            +
              def self.parser: () -> parser
         | 
| 1084 1086 |  | 
| 1085 | 
            -
              def self.parser=: ( | 
| 1087 | 
            +
              def self.parser=: (parser parser) -> void
         | 
| 1086 1088 |  | 
| 1087 1089 | 
             
              # <!--
         | 
| 1088 1090 | 
             
              #   rdoc-file=ext/json/lib/json/common.rb
         | 
| @@ -1116,7 +1118,7 @@ module JSON | |
| 1116 1118 | 
             
              #       }
         | 
| 1117 1119 | 
             
              #     }
         | 
| 1118 1120 | 
             
              #
         | 
| 1119 | 
            -
              def self?.pretty_generate: (_ToJson obj, ? | 
| 1121 | 
            +
              def self?.pretty_generate: (_ToJson obj, ?options opts) -> untyped
         | 
| 1120 1122 |  | 
| 1121 1123 | 
             
              alias self.pretty_unparse self.pretty_generate
         | 
| 1122 1124 |  | 
| @@ -1144,19 +1146,19 @@ module JSON | |
| 1144 1146 | 
             
              # <!-- rdoc-file=ext/json/lib/json/common.rb -->
         | 
| 1145 1147 | 
             
              # Sets or Returns the JSON generator state class that is used by JSON.
         | 
| 1146 1148 | 
             
              #
         | 
| 1147 | 
            -
              def self.state: () ->  | 
| 1149 | 
            +
              def self.state: () -> state
         | 
| 1148 1150 |  | 
| 1149 1151 | 
             
              # <!-- rdoc-file=ext/json/lib/json/common.rb -->
         | 
| 1150 1152 | 
             
              # Sets or Returns the JSON generator state class that is used by JSON.
         | 
| 1151 1153 | 
             
              #
         | 
| 1152 | 
            -
              def self.state=: ( | 
| 1154 | 
            +
              def self.state=: (state) -> state
         | 
| 1153 1155 |  | 
| 1154 1156 | 
             
              alias self.unparse self.generate
         | 
| 1155 1157 |  | 
| 1156 1158 | 
             
              alias unparse generate
         | 
| 1157 1159 | 
             
            end
         | 
| 1158 1160 |  | 
| 1159 | 
            -
            JSON::FAST_STATE_PROTOTYPE:  | 
| 1161 | 
            +
            JSON::FAST_STATE_PROTOTYPE: JSON::state
         | 
| 1160 1162 |  | 
| 1161 1163 | 
             
            JSON::Infinity: Float
         | 
| 1162 1164 |  | 
| @@ -1166,9 +1168,9 @@ JSON::MinusInfinity: Float | |
| 1166 1168 |  | 
| 1167 1169 | 
             
            JSON::NaN: Float
         | 
| 1168 1170 |  | 
| 1169 | 
            -
            JSON::PRETTY_STATE_PROTOTYPE:  | 
| 1171 | 
            +
            JSON::PRETTY_STATE_PROTOTYPE: JSON::state
         | 
| 1170 1172 |  | 
| 1171 | 
            -
            JSON::SAFE_STATE_PROTOTYPE:  | 
| 1173 | 
            +
            JSON::SAFE_STATE_PROTOTYPE: JSON::state
         | 
| 1172 1174 |  | 
| 1173 1175 | 
             
            JSON::VERSION: String
         | 
| 1174 1176 |  | 
| @@ -1213,8 +1215,8 @@ module Kernel | |
| 1213 1215 | 
             
              # The *opts* argument is passed through to generate/parse respectively. See
         | 
| 1214 1216 | 
             
              # generate and parse for their documentation.
         | 
| 1215 1217 | 
             
              #
         | 
| 1216 | 
            -
              def JSON: (string source, ? | 
| 1217 | 
            -
                      | (_ToJson obj, ? | 
| 1218 | 
            +
              def JSON: (string source, ?JSON::options opts) -> untyped
         | 
| 1219 | 
            +
                      | (_ToJson obj, ?JSON::options opts) -> String
         | 
| 1218 1220 | 
             
            end
         | 
| 1219 1221 |  | 
| 1220 1222 | 
             
            %a{annotate:rdoc:skip}
         | 
| @@ -12,15 +12,17 @@ | |
| 12 12 | 
             
            class Monitor
         | 
| 13 13 | 
             
              # <!--
         | 
| 14 14 | 
             
              #   rdoc-file=ext/monitor/monitor.c
         | 
| 15 | 
            -
              #   - enter | 
| 15 | 
            +
              #   - enter -> nil
         | 
| 16 16 | 
             
              # -->
         | 
| 17 | 
            +
              # Enters exclusive section.
         | 
| 17 18 | 
             
              #
         | 
| 18 19 | 
             
              def enter: () -> nil
         | 
| 19 20 |  | 
| 20 21 | 
             
              # <!--
         | 
| 21 22 | 
             
              #   rdoc-file=ext/monitor/monitor.c
         | 
| 22 | 
            -
              #   - exit | 
| 23 | 
            +
              #   - exit -> nil
         | 
| 23 24 | 
             
              # -->
         | 
| 25 | 
            +
              # Leaves exclusive section.
         | 
| 24 26 | 
             
              #
         | 
| 25 27 | 
             
              def exit: () -> nil
         | 
| 26 28 |  | 
| @@ -77,20 +79,25 @@ class Monitor | |
| 77 79 | 
             
              #   rdoc-file=ext/monitor/lib/monitor.rb
         | 
| 78 80 | 
             
              #   - new_cond()
         | 
| 79 81 | 
             
              # -->
         | 
| 82 | 
            +
              # Creates a new MonitorMixin::ConditionVariable associated with the Monitor
         | 
| 83 | 
            +
              # object.
         | 
| 80 84 | 
             
              #
         | 
| 81 85 | 
             
              def new_cond: () -> ::MonitorMixin::ConditionVariable
         | 
| 82 86 |  | 
| 83 87 | 
             
              # <!--
         | 
| 84 88 | 
             
              #   rdoc-file=ext/monitor/monitor.c
         | 
| 85 | 
            -
              #   - synchronize | 
| 89 | 
            +
              #   - synchronize { } -> result of the block
         | 
| 86 90 | 
             
              # -->
         | 
| 91 | 
            +
              # Enters exclusive section and executes the block.  Leaves the exclusive section
         | 
| 92 | 
            +
              # automatically when the block exits.  See example under `MonitorMixin`.
         | 
| 87 93 | 
             
              #
         | 
| 88 94 | 
             
              def synchronize: [T] () { () -> T } -> T
         | 
| 89 95 |  | 
| 90 96 | 
             
              # <!--
         | 
| 91 97 | 
             
              #   rdoc-file=ext/monitor/monitor.c
         | 
| 92 | 
            -
              #   - try_enter | 
| 98 | 
            +
              #   - try_enter -> true or false
         | 
| 93 99 | 
             
              # -->
         | 
| 100 | 
            +
              # Attempts to enter exclusive section.  Returns `false` if lock fails.
         | 
| 94 101 | 
             
              #
         | 
| 95 102 | 
             
              def try_enter: () -> bool
         | 
| 96 103 |  | 
| @@ -279,6 +286,8 @@ module MonitorMixin | |
| 279 286 | 
             
              #   rdoc-file=ext/monitor/lib/monitor.rb
         | 
| 280 287 | 
             
              #   - mon_check_owner()
         | 
| 281 288 | 
             
              # -->
         | 
| 289 | 
            +
              # Ensures that the MonitorMixin is owned by the current thread, otherwise raises
         | 
| 290 | 
            +
              # an exception.
         | 
| 282 291 | 
             
              #
         | 
| 283 292 | 
             
              def mon_check_owner: () -> nil
         | 
| 284 293 |  | 
| @@ -978,8 +978,8 @@ module Net | |
| 978 978 | 
             
                # Note: If `port` is `nil` and `opts[:use_ssl]` is a truthy value, the value
         | 
| 979 979 | 
             
                # passed to `new` is Net::HTTP.https_default_port, not `port`.
         | 
| 980 980 | 
             
                #
         | 
| 981 | 
            -
                def self.start: (String address, ?Integer? port, ?String | :ENV | nil p_addr, ?Integer? p_port, ?String? p_user, ?String? p_pass, ?Hash[Symbol, untyped] | 
| 982 | 
            -
                              | [T] (String address, ?Integer? port, ?String | :ENV | nil p_addr, ?Integer? p_port, ?String? p_user, ?String? p_pass, ?Hash[Symbol, untyped] | 
| 981 | 
            +
                def self.start: (String address, ?Integer? port, ?String | :ENV | nil p_addr, ?Integer? p_port, ?String? p_user, ?String? p_pass, ?Hash[Symbol, untyped]?, **untyped opt) -> Net::HTTP
         | 
| 982 | 
            +
                              | [T] (String address, ?Integer? port, ?String | :ENV | nil p_addr, ?Integer? p_port, ?String? p_user, ?String? p_pass, ?Hash[Symbol, untyped]?, **untyped opt) { (Net::HTTP) -> T } -> T
         | 
| 983 983 |  | 
| 984 984 | 
             
                # <!--
         | 
| 985 985 | 
             
                #   rdoc-file=lib/net/http.rb
         |