steep 0.14.0 → 0.16.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -3
  3. data/CHANGELOG.md +25 -0
  4. data/Rakefile +0 -13
  5. data/bin/setup +0 -2
  6. data/bin/smoke_runner.rb +0 -1
  7. data/exe/steep +0 -1
  8. data/lib/steep.rb +18 -2
  9. data/lib/steep/annotation_parser.rb +4 -4
  10. data/lib/steep/ast/buffer.rb +11 -7
  11. data/lib/steep/ast/builtin.rb +8 -0
  12. data/lib/steep/ast/types/factory.rb +55 -55
  13. data/lib/steep/cli.rb +16 -1
  14. data/lib/steep/drivers/annotations.rb +1 -1
  15. data/lib/steep/drivers/check.rb +20 -4
  16. data/lib/steep/drivers/langserver.rb +13 -457
  17. data/lib/steep/drivers/utils/driver_helper.rb +1 -1
  18. data/lib/steep/drivers/vendor.rb +2 -2
  19. data/lib/steep/drivers/watch.rb +97 -85
  20. data/lib/steep/drivers/worker.rb +51 -0
  21. data/lib/steep/project.rb +9 -5
  22. data/lib/steep/project/completion_provider.rb +9 -13
  23. data/lib/steep/project/dsl.rb +14 -0
  24. data/lib/steep/project/file.rb +43 -46
  25. data/lib/steep/project/hover_content.rb +17 -8
  26. data/lib/steep/project/options.rb +25 -3
  27. data/lib/steep/project/target.rb +40 -24
  28. data/lib/steep/server/base_worker.rb +56 -0
  29. data/lib/steep/server/code_worker.rb +151 -0
  30. data/lib/steep/server/interaction_worker.rb +281 -0
  31. data/lib/steep/server/master.rb +196 -0
  32. data/lib/steep/server/signature_worker.rb +148 -0
  33. data/lib/steep/server/utils.rb +36 -0
  34. data/lib/steep/server/worker_process.rb +62 -0
  35. data/lib/steep/signature/errors.rb +1 -1
  36. data/lib/steep/signature/validator.rb +13 -13
  37. data/lib/steep/source.rb +1 -1
  38. data/lib/steep/type_construction.rb +996 -726
  39. data/lib/steep/type_inference/constant_env.rb +3 -11
  40. data/lib/steep/type_inference/context.rb +8 -3
  41. data/lib/steep/type_inference/context_array.rb +111 -0
  42. data/lib/steep/type_inference/local_variable_type_env.rb +226 -0
  43. data/lib/steep/type_inference/logic.rb +130 -0
  44. data/lib/steep/type_inference/type_env.rb +5 -69
  45. data/lib/steep/typing.rb +79 -22
  46. data/lib/steep/version.rb +1 -1
  47. data/smoke/alias/Steepfile +1 -0
  48. data/smoke/and/Steepfile +1 -0
  49. data/smoke/array/Steepfile +1 -0
  50. data/smoke/array/b.rb +0 -2
  51. data/smoke/block/Steepfile +1 -0
  52. data/smoke/case/Steepfile +1 -0
  53. data/smoke/class/Steepfile +1 -0
  54. data/smoke/const/Steepfile +1 -0
  55. data/smoke/dstr/Steepfile +1 -0
  56. data/smoke/ensure/Steepfile +1 -0
  57. data/smoke/enumerator/Steepfile +1 -0
  58. data/smoke/extension/Steepfile +1 -0
  59. data/smoke/extension/c.rb +1 -0
  60. data/smoke/hash/Steepfile +1 -0
  61. data/smoke/hello/Steepfile +1 -0
  62. data/smoke/if/Steepfile +1 -0
  63. data/smoke/if/a.rb +1 -1
  64. data/smoke/implements/Steepfile +1 -0
  65. data/smoke/initialize/Steepfile +1 -0
  66. data/smoke/integer/Steepfile +1 -0
  67. data/smoke/interface/Steepfile +1 -0
  68. data/smoke/kwbegin/Steepfile +1 -0
  69. data/smoke/lambda/Steepfile +1 -0
  70. data/smoke/literal/Steepfile +1 -0
  71. data/smoke/map/Steepfile +1 -0
  72. data/smoke/method/Steepfile +1 -0
  73. data/smoke/module/Steepfile +1 -0
  74. data/smoke/regexp/Steepfile +1 -0
  75. data/smoke/regression/Steepfile +1 -0
  76. data/smoke/rescue/Steepfile +1 -0
  77. data/smoke/rescue/a.rb +1 -1
  78. data/smoke/self/Steepfile +1 -0
  79. data/smoke/skip/Steepfile +1 -0
  80. data/smoke/stdout/Steepfile +1 -0
  81. data/smoke/super/Steepfile +1 -0
  82. data/smoke/type_case/Steepfile +1 -0
  83. data/smoke/yield/Steepfile +1 -0
  84. data/steep.gemspec +7 -8
  85. metadata +26 -141
  86. data/exe/rbs +0 -3
  87. data/exe/ruby-signature +0 -3
  88. data/vendor/ruby-signature/.github/workflows/ruby.yml +0 -27
  89. data/vendor/ruby-signature/.gitignore +0 -12
  90. data/vendor/ruby-signature/.rubocop.yml +0 -15
  91. data/vendor/ruby-signature/BSDL +0 -22
  92. data/vendor/ruby-signature/COPYING +0 -56
  93. data/vendor/ruby-signature/Gemfile +0 -6
  94. data/vendor/ruby-signature/README.md +0 -93
  95. data/vendor/ruby-signature/Rakefile +0 -67
  96. data/vendor/ruby-signature/bin/annotate-with-rdoc +0 -156
  97. data/vendor/ruby-signature/bin/console +0 -14
  98. data/vendor/ruby-signature/bin/query-rdoc +0 -103
  99. data/vendor/ruby-signature/bin/setup +0 -10
  100. data/vendor/ruby-signature/bin/sort +0 -88
  101. data/vendor/ruby-signature/bin/test_runner.rb +0 -17
  102. data/vendor/ruby-signature/docs/CONTRIBUTING.md +0 -97
  103. data/vendor/ruby-signature/docs/sigs.md +0 -148
  104. data/vendor/ruby-signature/docs/stdlib.md +0 -152
  105. data/vendor/ruby-signature/docs/syntax.md +0 -528
  106. data/vendor/ruby-signature/exe/rbs +0 -3
  107. data/vendor/ruby-signature/exe/ruby-signature +0 -7
  108. data/vendor/ruby-signature/lib/ruby/signature.rb +0 -64
  109. data/vendor/ruby-signature/lib/ruby/signature/ast/annotation.rb +0 -29
  110. data/vendor/ruby-signature/lib/ruby/signature/ast/comment.rb +0 -29
  111. data/vendor/ruby-signature/lib/ruby/signature/ast/declarations.rb +0 -391
  112. data/vendor/ruby-signature/lib/ruby/signature/ast/members.rb +0 -364
  113. data/vendor/ruby-signature/lib/ruby/signature/buffer.rb +0 -52
  114. data/vendor/ruby-signature/lib/ruby/signature/builtin_names.rb +0 -54
  115. data/vendor/ruby-signature/lib/ruby/signature/cli.rb +0 -555
  116. data/vendor/ruby-signature/lib/ruby/signature/constant.rb +0 -28
  117. data/vendor/ruby-signature/lib/ruby/signature/constant_table.rb +0 -152
  118. data/vendor/ruby-signature/lib/ruby/signature/definition.rb +0 -172
  119. data/vendor/ruby-signature/lib/ruby/signature/definition_builder.rb +0 -921
  120. data/vendor/ruby-signature/lib/ruby/signature/environment.rb +0 -283
  121. data/vendor/ruby-signature/lib/ruby/signature/environment_loader.rb +0 -138
  122. data/vendor/ruby-signature/lib/ruby/signature/environment_walker.rb +0 -126
  123. data/vendor/ruby-signature/lib/ruby/signature/errors.rb +0 -189
  124. data/vendor/ruby-signature/lib/ruby/signature/location.rb +0 -104
  125. data/vendor/ruby-signature/lib/ruby/signature/method_type.rb +0 -125
  126. data/vendor/ruby-signature/lib/ruby/signature/namespace.rb +0 -93
  127. data/vendor/ruby-signature/lib/ruby/signature/parser.y +0 -1344
  128. data/vendor/ruby-signature/lib/ruby/signature/prototype/rb.rb +0 -444
  129. data/vendor/ruby-signature/lib/ruby/signature/prototype/rbi.rb +0 -579
  130. data/vendor/ruby-signature/lib/ruby/signature/prototype/runtime.rb +0 -383
  131. data/vendor/ruby-signature/lib/ruby/signature/substitution.rb +0 -48
  132. data/vendor/ruby-signature/lib/ruby/signature/test.rb +0 -28
  133. data/vendor/ruby-signature/lib/ruby/signature/test/errors.rb +0 -63
  134. data/vendor/ruby-signature/lib/ruby/signature/test/hook.rb +0 -290
  135. data/vendor/ruby-signature/lib/ruby/signature/test/setup.rb +0 -58
  136. data/vendor/ruby-signature/lib/ruby/signature/test/spy.rb +0 -327
  137. data/vendor/ruby-signature/lib/ruby/signature/test/test_helper.rb +0 -185
  138. data/vendor/ruby-signature/lib/ruby/signature/test/type_check.rb +0 -256
  139. data/vendor/ruby-signature/lib/ruby/signature/type_name.rb +0 -72
  140. data/vendor/ruby-signature/lib/ruby/signature/types.rb +0 -932
  141. data/vendor/ruby-signature/lib/ruby/signature/variance_calculator.rb +0 -140
  142. data/vendor/ruby-signature/lib/ruby/signature/vendorer.rb +0 -49
  143. data/vendor/ruby-signature/lib/ruby/signature/version.rb +0 -5
  144. data/vendor/ruby-signature/lib/ruby/signature/writer.rb +0 -271
  145. data/vendor/ruby-signature/ruby-signature.gemspec +0 -45
  146. data/vendor/ruby-signature/stdlib/abbrev/abbrev.rbs +0 -3
  147. data/vendor/ruby-signature/stdlib/base64/base64.rbs +0 -15
  148. data/vendor/ruby-signature/stdlib/builtin/array.rbs +0 -1997
  149. data/vendor/ruby-signature/stdlib/builtin/basic_object.rbs +0 -280
  150. data/vendor/ruby-signature/stdlib/builtin/binding.rbs +0 -177
  151. data/vendor/ruby-signature/stdlib/builtin/builtin.rbs +0 -35
  152. data/vendor/ruby-signature/stdlib/builtin/class.rbs +0 -145
  153. data/vendor/ruby-signature/stdlib/builtin/comparable.rbs +0 -116
  154. data/vendor/ruby-signature/stdlib/builtin/complex.rbs +0 -400
  155. data/vendor/ruby-signature/stdlib/builtin/constants.rbs +0 -37
  156. data/vendor/ruby-signature/stdlib/builtin/data.rbs +0 -5
  157. data/vendor/ruby-signature/stdlib/builtin/deprecated.rbs +0 -2
  158. data/vendor/ruby-signature/stdlib/builtin/dir.rbs +0 -419
  159. data/vendor/ruby-signature/stdlib/builtin/encoding.rbs +0 -606
  160. data/vendor/ruby-signature/stdlib/builtin/enumerable.rbs +0 -404
  161. data/vendor/ruby-signature/stdlib/builtin/enumerator.rbs +0 -260
  162. data/vendor/ruby-signature/stdlib/builtin/errno.rbs +0 -781
  163. data/vendor/ruby-signature/stdlib/builtin/errors.rbs +0 -582
  164. data/vendor/ruby-signature/stdlib/builtin/exception.rbs +0 -193
  165. data/vendor/ruby-signature/stdlib/builtin/false_class.rbs +0 -40
  166. data/vendor/ruby-signature/stdlib/builtin/fiber.rbs +0 -68
  167. data/vendor/ruby-signature/stdlib/builtin/fiber_error.rbs +0 -12
  168. data/vendor/ruby-signature/stdlib/builtin/file.rbs +0 -476
  169. data/vendor/ruby-signature/stdlib/builtin/file_test.rbs +0 -59
  170. data/vendor/ruby-signature/stdlib/builtin/float.rbs +0 -696
  171. data/vendor/ruby-signature/stdlib/builtin/gc.rbs +0 -121
  172. data/vendor/ruby-signature/stdlib/builtin/hash.rbs +0 -1029
  173. data/vendor/ruby-signature/stdlib/builtin/integer.rbs +0 -710
  174. data/vendor/ruby-signature/stdlib/builtin/io.rbs +0 -683
  175. data/vendor/ruby-signature/stdlib/builtin/kernel.rbs +0 -574
  176. data/vendor/ruby-signature/stdlib/builtin/marshal.rbs +0 -135
  177. data/vendor/ruby-signature/stdlib/builtin/match_data.rbs +0 -271
  178. data/vendor/ruby-signature/stdlib/builtin/math.rbs +0 -66
  179. data/vendor/ruby-signature/stdlib/builtin/method.rbs +0 -182
  180. data/vendor/ruby-signature/stdlib/builtin/module.rbs +0 -248
  181. data/vendor/ruby-signature/stdlib/builtin/nil_class.rbs +0 -82
  182. data/vendor/ruby-signature/stdlib/builtin/numeric.rbs +0 -409
  183. data/vendor/ruby-signature/stdlib/builtin/object.rbs +0 -824
  184. data/vendor/ruby-signature/stdlib/builtin/proc.rbs +0 -426
  185. data/vendor/ruby-signature/stdlib/builtin/process.rbs +0 -354
  186. data/vendor/ruby-signature/stdlib/builtin/random.rbs +0 -93
  187. data/vendor/ruby-signature/stdlib/builtin/range.rbs +0 -226
  188. data/vendor/ruby-signature/stdlib/builtin/rational.rbs +0 -424
  189. data/vendor/ruby-signature/stdlib/builtin/rb_config.rbs +0 -10
  190. data/vendor/ruby-signature/stdlib/builtin/regexp.rbs +0 -1083
  191. data/vendor/ruby-signature/stdlib/builtin/ruby_vm.rbs +0 -14
  192. data/vendor/ruby-signature/stdlib/builtin/signal.rbs +0 -55
  193. data/vendor/ruby-signature/stdlib/builtin/string.rbs +0 -1894
  194. data/vendor/ruby-signature/stdlib/builtin/string_io.rbs +0 -13
  195. data/vendor/ruby-signature/stdlib/builtin/struct.rbs +0 -40
  196. data/vendor/ruby-signature/stdlib/builtin/symbol.rbs +0 -230
  197. data/vendor/ruby-signature/stdlib/builtin/thread.rbs +0 -1112
  198. data/vendor/ruby-signature/stdlib/builtin/thread_group.rbs +0 -23
  199. data/vendor/ruby-signature/stdlib/builtin/time.rbs +0 -739
  200. data/vendor/ruby-signature/stdlib/builtin/trace_point.rbs +0 -91
  201. data/vendor/ruby-signature/stdlib/builtin/true_class.rbs +0 -46
  202. data/vendor/ruby-signature/stdlib/builtin/unbound_method.rbs +0 -159
  203. data/vendor/ruby-signature/stdlib/builtin/warning.rbs +0 -17
  204. data/vendor/ruby-signature/stdlib/erb/erb.rbs +0 -18
  205. data/vendor/ruby-signature/stdlib/find/find.rbs +0 -44
  206. data/vendor/ruby-signature/stdlib/pathname/pathname.rbs +0 -21
  207. data/vendor/ruby-signature/stdlib/prime/integer-extension.rbs +0 -23
  208. data/vendor/ruby-signature/stdlib/prime/prime.rbs +0 -188
  209. data/vendor/ruby-signature/stdlib/securerandom/securerandom.rbs +0 -9
  210. data/vendor/ruby-signature/stdlib/set/set.rbs +0 -77
  211. data/vendor/ruby-signature/stdlib/tmpdir/tmpdir.rbs +0 -53
@@ -1,182 +0,0 @@
1
- class Method < Object
2
- # Returns a `Proc` object corresponding to this method.
3
- def to_proc: () -> Proc
4
-
5
- # Invokes the *meth* with the specified arguments, returning the method’s
6
- # return value.
7
- #
8
- # ```ruby
9
- # m = 12.method("+")
10
- # m.call(3) #=> 15
11
- # m.call(20) #=> 32
12
- # ```
13
- def call: (*untyped args) -> untyped
14
-
15
- # Returns a proc that is the composition of this method and the given *g*
16
- # . The returned proc takes a variable number of arguments, calls *g* with
17
- # them then calls this method with the result.
18
- #
19
- # ```ruby
20
- # def f(x)
21
- # x * x
22
- # end
23
- #
24
- # f = self.method(:f)
25
- # g = proc {|x| x + x }
26
- # p (f << g).call(2) #=> 16
27
- # ```
28
- def <<: (untyped g) -> untyped
29
-
30
- # Invokes the method with `obj` as the parameter like
31
- # [call](Method.downloaded.ruby_doc#method-i-call). This allows a method
32
- # object to be the target of a `when` clause in a case statement.
33
- #
34
- # ```ruby
35
- # require 'prime'
36
- #
37
- # case 1373
38
- # when Prime.method(:prime?)
39
- # # ...
40
- # end
41
- # ```
42
- def ===: (*untyped obj) -> untyped
43
-
44
- # Returns a proc that is the composition of this method and the given *g*
45
- # . The returned proc takes a variable number of arguments, calls *g* with
46
- # them then calls this method with the result.
47
- #
48
- # ```ruby
49
- # def f(x)
50
- # x * x
51
- # end
52
- #
53
- # f = self.method(:f)
54
- # g = proc {|x| x + x }
55
- # p (f >> g).call(2) #=> 8
56
- # ```
57
- def >>: (untyped g) -> untyped
58
-
59
- # Invokes the *meth* with the specified arguments, returning the method’s
60
- # return value.
61
- #
62
- # ```ruby
63
- # m = 12.method("+")
64
- # m.call(3) #=> 15
65
- # m.call(20) #=> 32
66
- # ```
67
- def []: (*untyped args) -> untyped
68
-
69
- # Returns an indication of the number of arguments accepted by a method.
70
- # Returns a nonnegative integer for methods that take a fixed number of
71
- # arguments. For Ruby methods that take a variable number of arguments,
72
- # returns -n-1, where n is the number of required arguments. Keyword
73
- # arguments will be considered as a single additional argument, that
74
- # argument being mandatory if any keyword argument is mandatory. For
75
- # methods written in C, returns -1 if the call takes a variable number of
76
- # arguments.
77
- #
78
- # class C
79
- # def one; end
80
- # def two(a); end
81
- # def three(*a); end
82
- # def four(a, b); end
83
- # def five(a, b, *c); end
84
- # def six(a, b, *c, &d); end
85
- # def seven(a, b, x:0); end
86
- # def eight(x:, y:); end
87
- # def nine(x:, y:, **z); end
88
- # def ten(*a, x:, y:); end
89
- # end
90
- # c = C.new
91
- # c.method(:one).arity #=> 0
92
- # c.method(:two).arity #=> 1
93
- # c.method(:three).arity #=> -1
94
- # c.method(:four).arity #=> 2
95
- # c.method(:five).arity #=> -3
96
- # c.method(:six).arity #=> -3
97
- # c.method(:seven).arity #=> -3
98
- # c.method(:eight).arity #=> 1
99
- # c.method(:nine).arity #=> 1
100
- # c.method(:ten).arity #=> -2
101
- #
102
- # "cat".method(:size).arity #=> 0
103
- # "cat".method(:replace).arity #=> 1
104
- # "cat".method(:squeeze).arity #=> -1
105
- # "cat".method(:count).arity #=> -1
106
- def arity: () -> Integer
107
-
108
- # Returns a clone of this method.
109
- #
110
- # ```ruby
111
- # class A
112
- # def foo
113
- # return "bar"
114
- # end
115
- # end
116
- #
117
- # m = A.new.method(:foo)
118
- # m.call # => "bar"
119
- # n = m.clone.call # => "bar"
120
- # ```
121
- def clone: () -> Method
122
-
123
- def curry: (*untyped args) -> untyped
124
-
125
- # Returns the name of the method.
126
- def name: () -> Symbol
127
-
128
- # Returns the original name of the method.
129
- #
130
- # ```ruby
131
- # class C
132
- # def foo; end
133
- # alias bar foo
134
- # end
135
- # C.instance_method(:bar).original_name # => :foo
136
- # ```
137
- def original_name: () -> Symbol
138
-
139
- # Returns the class or module that defines the method. See also receiver.
140
- #
141
- # ```ruby
142
- # (1..3).method(:map).owner #=> Enumerable
143
- # ```
144
- def owner: () -> (Class | Module)
145
-
146
- # Returns the parameter information of this method.
147
- #
148
- # ```ruby
149
- # def foo(bar); end
150
- # method(:foo).parameters #=> [[:req, :bar]]
151
- #
152
- # def foo(bar, baz, bat, &blk); end
153
- # method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:req, :bat], [:block, :blk]]
154
- #
155
- # def foo(bar, *args); end
156
- # method(:foo).parameters #=> [[:req, :bar], [:rest, :args]]
157
- #
158
- # def foo(bar, baz, *args, &blk); end
159
- # method(:foo).parameters #=> [[:req, :bar], [:req, :baz], [:rest, :args], [:block, :blk]]
160
- # ```
161
- def parameters: () -> ::Array[untyped]
162
-
163
- # Returns the bound receiver of the method object.
164
- #
165
- # ```ruby
166
- # (1..3).method(:map).receiver # => 1..3
167
- # ```
168
- def receiver: () -> untyped
169
-
170
- # Returns the Ruby source filename and line number containing this method
171
- # or nil if this method was not defined in Ruby (i.e. native).
172
- def source_location: () -> untyped
173
-
174
- # Returns a [Method](Method.downloaded.ruby_doc) of superclass which would
175
- # be called when super is used or nil if there is no method on superclass.
176
- def super_method: () -> Method?
177
-
178
- # Dissociates *meth* from its current receiver. The resulting
179
- # `UnboundMethod` can subsequently be bound to a new object of the same
180
- # class (see `UnboundMethod` ).
181
- def unbind: () -> untyped
182
- end
@@ -1,248 +0,0 @@
1
- # A `Module` is a collection of methods and constants. The methods in a
2
- # module may be instance methods or module methods. Instance methods
3
- # appear as methods in a class when the module is included, module methods
4
- # do not. Conversely, module methods may be called without creating an
5
- # encapsulating object, while instance methods may not. (See
6
- # `Module#module_function` .)
7
- #
8
- # In the descriptions that follow, the parameter *sym* refers to a symbol,
9
- # which is either a quoted string or a `Symbol` (such as `:name` ).
10
- #
11
- # ```ruby
12
- # module Mod
13
- # include Math
14
- # CONST = 1
15
- # def meth
16
- # # ...
17
- # end
18
- # end
19
- # Mod.class #=> Module
20
- # Mod.constants #=> [:CONST, :PI, :E]
21
- # Mod.instance_methods #=> [:meth]
22
- # ```
23
- class Module < Object
24
- # In the first form, returns an array of the names of all constants
25
- # accessible from the point of call. This list includes the names of all
26
- # modules and classes defined in the global scope.
27
- #
28
- # ```ruby
29
- # Module.constants.first(4)
30
- # # => [:ARGF, :ARGV, :ArgumentError, :Array]
31
- #
32
- # Module.constants.include?(:SEEK_SET) # => false
33
- #
34
- # class IO
35
- # Module.constants.include?(:SEEK_SET) # => true
36
- # end
37
- # ```
38
- #
39
- # The second form calls the instance method `constants` .
40
- def self.constants: () -> ::Array[Integer]
41
-
42
- # Returns the list of `Modules` nested at the point of call.
43
- #
44
- # ```ruby
45
- # module M1
46
- # module M2
47
- # $a = Module.nesting
48
- # end
49
- # end
50
- # $a #=> [M1::M2, M1]
51
- # $a[0].name #=> "M1::M2"
52
- # ```
53
- def self.nesting: () -> ::Array[Module]
54
-
55
- def self.used_modules: () -> ::Array[Module]
56
-
57
- def <: (Module other) -> bool?
58
-
59
- def <=: (Module other) -> bool?
60
-
61
- def <=>: (Module other) -> Integer?
62
-
63
- def ==: (untyped other) -> bool
64
-
65
- def ===: (untyped other) -> bool
66
-
67
- def >: (Module other) -> bool?
68
-
69
- def >=: (Module other) -> bool?
70
-
71
- def alias_method: (Symbol new_name, Symbol old_name) -> self
72
-
73
- # Returns a list of modules included/prepended in *mod* (including *mod*
74
- # itself).
75
- #
76
- # ```ruby
77
- # module Mod
78
- # include Math
79
- # include Comparable
80
- # prepend Enumerable
81
- # end
82
- #
83
- # Mod.ancestors #=> [Enumerable, Mod, Comparable, Math]
84
- # Math.ancestors #=> [Math]
85
- # Enumerable.ancestors #=> [Enumerable]
86
- # ```
87
- def ancestors: () -> ::Array[Module]
88
-
89
- def append_features: (Module arg0) -> self
90
-
91
- def `attr_accessor`: (*Symbol | String arg0) -> NilClass
92
-
93
- def `attr_reader`: (*Symbol | String arg0) -> NilClass
94
-
95
- def `attr_writer`: (*Symbol | String arg0) -> NilClass
96
-
97
- def autoload: (Symbol _module, String filename) -> NilClass
98
-
99
- def autoload?: (Symbol name) -> String?
100
-
101
- def class_eval: (String arg0, ?String filename, ?Integer lineno) -> untyped
102
- | [U] (untyped arg0) { (untyped m) -> U } -> U
103
-
104
- def class_exec: (*untyped args) { () -> untyped } -> untyped
105
-
106
- def class_variable_defined?: (Symbol | String arg0) -> bool
107
-
108
- def class_variable_get: (Symbol | String arg0) -> untyped
109
-
110
- def class_variable_set: (Symbol | String arg0, untyped arg1) -> untyped
111
-
112
- def class_variables: (?bool inherit) -> ::Array[Symbol]
113
-
114
- def const_defined?: (Symbol | String arg0, ?bool inherit) -> bool
115
-
116
- def const_get: (Symbol | String arg0, ?bool inherit) -> untyped
117
-
118
- def const_missing: (Symbol arg0) -> untyped
119
-
120
- def const_set: (Symbol | String arg0, untyped arg1) -> untyped
121
-
122
- def constants: (?bool inherit) -> ::Array[Symbol]
123
-
124
- def define_method: (Symbol | String arg0, ?Proc | Method | UnboundMethod arg1) -> Symbol
125
- | (Symbol | String arg0) { () -> untyped } -> Symbol
126
-
127
- def eql?: (untyped other) -> bool
128
-
129
- def equal?: (untyped other) -> bool
130
-
131
- def extend_object: (untyped arg0) -> untyped
132
-
133
- def extended: (Module othermod) -> untyped
134
-
135
- # Prevents further modifications to *mod* .
136
- #
137
- # This method returns self.
138
- def freeze: () -> self
139
-
140
- def `include`: (*Module arg0) -> self
141
-
142
- def `include?`: (Module arg0) -> bool
143
-
144
- def included: (Module othermod) -> untyped
145
-
146
- # Returns the list of modules included in *mod* .
147
- #
148
- # ```ruby
149
- # module Mixin
150
- # end
151
- #
152
- # module Outer
153
- # include Mixin
154
- # end
155
- #
156
- # Mixin.included_modules #=> []
157
- # Outer.included_modules #=> [Mixin]
158
- # ```
159
- def included_modules: () -> ::Array[Module]
160
-
161
- def initialize: () -> Object
162
- | () { (Module arg0) -> untyped } -> void
163
-
164
- def instance_method: (Symbol arg0) -> UnboundMethod
165
-
166
- def instance_methods: (?bool include_super) -> ::Array[Symbol]
167
-
168
- def method_added: (Symbol meth) -> untyped
169
-
170
- def method_defined?: (Symbol | String arg0) -> bool
171
-
172
- def method_removed: (Symbol method_name) -> untyped
173
-
174
- def module_eval: (String arg0, ?String filename, ?Integer lineno) -> untyped
175
- | [U] (untyped arg0) { (untyped m) -> U } -> U
176
-
177
- def module_exec: (*untyped args) { () -> untyped } -> untyped
178
-
179
- def module_function: (*Symbol | String arg0) -> self
180
-
181
- # Returns the name of the module *mod* . Returns nil for anonymous
182
- # modules.
183
- def name: () -> String?
184
-
185
- def `prepend`: (*Module arg0) -> self
186
-
187
- def prepend_features: (Module arg0) -> self
188
-
189
- def prepended: (Module othermod) -> untyped
190
-
191
- def `private`: (*Symbol | String arg0) -> self
192
-
193
- def private_class_method: (*Symbol | String arg0) -> self
194
-
195
- def private_constant: (*Symbol arg0) -> self
196
-
197
- def private_instance_methods: (?bool include_super) -> ::Array[Symbol]
198
-
199
- def private_method_defined?: (Symbol | String arg0) -> bool
200
-
201
- def protected: (*Symbol | String arg0) -> self
202
-
203
- def protected_instance_methods: (?bool include_super) -> ::Array[Symbol]
204
-
205
- def protected_method_defined?: (Symbol | String arg0) -> bool
206
-
207
- def `public`: (*Symbol | String arg0) -> self
208
-
209
- def public_class_method: (*Symbol | String arg0) -> self
210
-
211
- def public_constant: (*Symbol arg0) -> self
212
-
213
- def public_instance_method: (Symbol arg0) -> UnboundMethod
214
-
215
- def public_instance_methods: (?bool include_super) -> ::Array[Symbol]
216
-
217
- def public_method_defined?: (Symbol | String arg0) -> bool
218
-
219
- def refine: (Class arg0) { (untyped arg0) -> untyped } -> self
220
-
221
- def remove_class_variable: (Symbol arg0) -> untyped
222
-
223
- def remove_const: (Symbol arg0) -> untyped
224
-
225
- def remove_method: (Symbol | String arg0) -> self
226
-
227
- # Returns `true` if *mod* is a singleton class or `false` if it is an
228
- # ordinary class or module.
229
- #
230
- # ```ruby
231
- # class C
232
- # end
233
- # C.singleton_class? #=> false
234
- # C.singleton_class.singleton_class? #=> true
235
- # ```
236
- def `singleton_class?`: () -> bool
237
-
238
- def to_s: () -> String
239
-
240
- def undefMethod: (Symbol | String arg0) -> self
241
-
242
- def using: (Module arg0) -> self
243
-
244
- # Alias for: [to\_s](Module.downloaded.ruby_doc#method-i-to_s)
245
- def inspect: () -> String
246
-
247
- def attr: (*Symbol | String arg0) -> NilClass
248
- end
@@ -1,82 +0,0 @@
1
- # The class of the singleton object `nil`.
2
- #
3
- class NilClass
4
- public
5
-
6
- # And---Returns `false`. *obj* is always evaluated as it is the argument to a
7
- # method call---there is no short-circuit evaluation in this case.
8
- #
9
- def &: (untyped obj) -> bool
10
-
11
- # Case Equality -- For class Object, effectively the same as calling `#==`, but
12
- # typically overridden by descendants to provide meaningful semantics in `case`
13
- # statements.
14
- #
15
- def ===: (nil) -> true
16
- | (untyped obj) -> bool
17
-
18
- # Dummy pattern matching -- always returns nil.
19
- #
20
- def =~: (untyped obj) -> nil
21
-
22
- # Exclusive Or---If *obj* is `nil` or `false`, returns `false`; otherwise,
23
- # returns `true`.
24
- #
25
- def ^: (nil) -> false
26
- | (false) -> false
27
- | (untyped obj) -> bool
28
-
29
- # Always returns the string "nil".
30
- #
31
- def inspect: () -> "nil"
32
-
33
- # Only the object *nil* responds `true` to `nil?`.
34
- #
35
- def nil?: () -> bool
36
-
37
- # Returns zero as a rational. The optional argument `eps` is always ignored.
38
- #
39
- def rationalize: (?untyped eps) -> Rational
40
-
41
- # Always returns an empty array.
42
- #
43
- # nil.to_a #=> []
44
- #
45
- def to_a: () -> [ ]
46
-
47
- # Returns zero as a complex.
48
- #
49
- def to_c: () -> Complex
50
-
51
- # Always returns zero.
52
- #
53
- # nil.to_f #=> 0.0
54
- #
55
- def to_f: () -> Float
56
-
57
- # Always returns an empty hash.
58
- #
59
- # nil.to_h #=> {}
60
- #
61
- def to_h: () -> ::Hash[untyped, untyped]
62
-
63
- # Always returns zero.
64
- #
65
- # nil.to_i #=> 0
66
- #
67
- def to_i: () -> 0
68
-
69
- # Returns zero as a rational.
70
- #
71
- def to_r: () -> Rational
72
-
73
- # Always returns the empty string.
74
- #
75
- def to_s: () -> ""
76
-
77
- # Or---Returns `false` if *obj* is `nil` or `false`; `true` otherwise.
78
- #
79
- def |: (nil) -> false
80
- | (false) -> false
81
- | (untyped obj) -> bool
82
- end