rbs 1.7.0.beta.4 → 1.8.0

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/CHANGELOG.md +58 -2
  4. data/Steepfile +0 -1
  5. data/core/array.rbs +3 -3
  6. data/core/binding.rbs +2 -0
  7. data/core/builtin.rbs +4 -0
  8. data/core/complex.rbs +0 -2
  9. data/core/enumerable.rbs +3 -3
  10. data/core/env.rbs +881 -0
  11. data/core/false_class.rbs +2 -0
  12. data/core/float.rbs +0 -2
  13. data/core/integer.rbs +0 -2
  14. data/core/nil_class.rbs +2 -0
  15. data/core/numeric.rbs +7 -0
  16. data/core/object.rbs +1 -1
  17. data/core/proc.rbs +2 -0
  18. data/core/rational.rbs +0 -2
  19. data/core/symbol.rbs +2 -0
  20. data/core/thread.rbs +1 -1
  21. data/core/true_class.rbs +2 -0
  22. data/core/unbound_method.rbs +13 -0
  23. data/docs/rbs_by_example.md +2 -2
  24. data/docs/syntax.md +25 -23
  25. data/ext/rbs_extension/parser.c +99 -95
  26. data/ext/rbs_extension/parserstate.c +0 -1
  27. data/ext/rbs_extension/rbs_extension.h +1 -1
  28. data/ext/rbs_extension/ruby_objs.c +8 -6
  29. data/ext/rbs_extension/ruby_objs.h +2 -4
  30. data/lib/rbs/ast/declarations.rb +6 -2
  31. data/lib/rbs/cli.rb +1 -1
  32. data/lib/rbs/collection/sources/git.rb +6 -1
  33. data/lib/rbs/definition_builder.rb +29 -2
  34. data/lib/rbs/environment.rb +1 -0
  35. data/lib/rbs/environment_walker.rb +4 -1
  36. data/lib/rbs/errors.rb +12 -0
  37. data/lib/rbs/prototype/helpers.rb +113 -0
  38. data/lib/rbs/prototype/rb.rb +2 -105
  39. data/lib/rbs/prototype/runtime.rb +16 -0
  40. data/lib/rbs/test/setup.rb +1 -0
  41. data/lib/rbs/type_alias_regularity.rb +115 -0
  42. data/lib/rbs/types.rb +11 -23
  43. data/lib/rbs/validator.rb +40 -7
  44. data/lib/rbs/variance_calculator.rb +52 -24
  45. data/lib/rbs/version.rb +1 -1
  46. data/lib/rbs/writer.rb +1 -1
  47. data/lib/rbs.rb +2 -0
  48. data/schema/decls.json +13 -1
  49. data/schema/types.json +8 -2
  50. data/sig/collection/collections.rbs +2 -0
  51. data/sig/declarations.rbs +9 -6
  52. data/sig/definition_builder.rbs +29 -0
  53. data/sig/environment_walker.rbs +26 -0
  54. data/sig/errors.rbs +10 -0
  55. data/sig/type_alias_regularity.rbs +92 -0
  56. data/sig/types.rbs +11 -8
  57. data/sig/validator.rbs +7 -0
  58. data/sig/variance_calculator.rbs +50 -0
  59. data/stdlib/bigdecimal/0/big_decimal.rbs +44 -0
  60. data/stdlib/csv/0/csv.rbs +49 -3
  61. data/stdlib/date/0/date.rbs +2 -2
  62. data/stdlib/set/0/set.rbs +3 -3
  63. data/steep/Gemfile.lock +10 -10
  64. metadata +8 -6
  65. data/lib/rbs/parser.y +0 -1805
  66. data/lib/ruby/signature.rb +0 -7
@@ -446,7 +446,7 @@ class Date
446
446
  # DateTime.jd(0,12) + DateTime.new(2001,2,3).ajd
447
447
  # #=> #<DateTime: 2001-02-03T00:00:00+00:00 ...>
448
448
  #
449
- def +: (Integer | Rational other) -> Date
449
+ def +: ((Numeric & _ToR) other) -> Date
450
450
 
451
451
  # Returns the difference between the two dates if the other is a date object.
452
452
  # If the other is a numeric value, returns a date object pointing `other` days
@@ -461,7 +461,7 @@ class Date
461
461
  # DateTime.new(2001,2,3) - DateTime.new(2001,2,2,12)
462
462
  # #=> (1/2)
463
463
  #
464
- def -: (Integer | Rational other) -> Date
464
+ def -: ((Numeric & _ToR) other) -> Date
465
465
  | (Date other) -> Rational
466
466
 
467
467
  # Returns a date object pointing `n` months before self. The argument `n` should
data/stdlib/set/0/set.rbs CHANGED
@@ -122,7 +122,7 @@ class Set[A]
122
122
  #
123
123
  # See also Enumerable#include?
124
124
  #
125
- def include?: (untyped) -> bool
125
+ def include?: (A) -> bool
126
126
 
127
127
  alias member? include?
128
128
 
@@ -168,12 +168,12 @@ class Set[A]
168
168
  # Deletes the given object from the set and returns self. Use `subtract` to
169
169
  # delete many items at once.
170
170
  #
171
- def delete: (untyped) -> self
171
+ def delete: (A) -> self
172
172
 
173
173
  # Deletes the given object from the set and returns self. If the object is not
174
174
  # in the set, returns nil.
175
175
  #
176
- def delete?: (untyped) -> self?
176
+ def delete?: (A) -> self?
177
177
 
178
178
  # Deletes every element of the set for which block evaluates to true, and
179
179
  # returns self. Returns an enumerator if no block is given.
data/steep/Gemfile.lock CHANGED
@@ -9,37 +9,37 @@ GEM
9
9
  zeitwerk (~> 2.3)
10
10
  ast (2.4.2)
11
11
  concurrent-ruby (1.1.9)
12
- ffi (1.15.3)
13
- i18n (1.8.10)
12
+ ffi (1.15.4)
13
+ i18n (1.8.11)
14
14
  concurrent-ruby (~> 1.0)
15
15
  language_server-protocol (3.16.0.3)
16
16
  listen (3.7.0)
17
17
  rb-fsevent (~> 0.10, >= 0.10.3)
18
18
  rb-inotify (~> 0.9, >= 0.9.10)
19
19
  minitest (5.14.4)
20
- parallel (1.20.1)
21
- parser (3.0.2.0)
20
+ parallel (1.21.0)
21
+ parser (3.0.3.1)
22
22
  ast (~> 2.4.1)
23
23
  rainbow (3.0.0)
24
24
  rb-fsevent (0.11.0)
25
25
  rb-inotify (0.10.1)
26
26
  ffi (~> 1.0)
27
- rbs (1.5.1)
28
- steep (0.46.0)
27
+ rbs (1.7.1)
28
+ steep (0.47.0)
29
29
  activesupport (>= 5.1)
30
30
  language_server-protocol (>= 3.15, < 4.0)
31
31
  listen (~> 3.0)
32
32
  parallel (>= 1.0.0)
33
33
  parser (>= 3.0)
34
34
  rainbow (>= 2.2.2, < 4.0)
35
- rbs (>= 1.2.0)
35
+ rbs (~> 1.7.0)
36
36
  terminal-table (>= 2, < 4)
37
- terminal-table (3.0.1)
37
+ terminal-table (3.0.2)
38
38
  unicode-display_width (>= 1.1.1, < 3)
39
39
  tzinfo (2.0.4)
40
40
  concurrent-ruby (~> 1.0)
41
- unicode-display_width (2.0.0)
42
- zeitwerk (2.4.2)
41
+ unicode-display_width (2.1.0)
42
+ zeitwerk (2.5.1)
43
43
 
44
44
  PLATFORMS
45
45
  ruby
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0.beta.4
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-22 00:00:00.000000000 Z
11
+ date: 2021-12-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RBS is the language for type signatures for Ruby and standard library
14
14
  definitions.
@@ -44,6 +44,7 @@ files:
44
44
  - core/encoding.rbs
45
45
  - core/enumerable.rbs
46
46
  - core/enumerator.rbs
47
+ - core/env.rbs
47
48
  - core/errno.rbs
48
49
  - core/errors.rbs
49
50
  - core/exception.rbs
@@ -152,12 +153,12 @@ files:
152
153
  - lib/rbs/locator.rb
153
154
  - lib/rbs/method_type.rb
154
155
  - lib/rbs/namespace.rb
155
- - lib/rbs/parser.y
156
156
  - lib/rbs/parser_aux.rb
157
157
  - lib/rbs/parser_compat/lexer_error.rb
158
158
  - lib/rbs/parser_compat/located_value.rb
159
159
  - lib/rbs/parser_compat/semantics_error.rb
160
160
  - lib/rbs/parser_compat/syntax_error.rb
161
+ - lib/rbs/prototype/helpers.rb
161
162
  - lib/rbs/prototype/rb.rb
162
163
  - lib/rbs/prototype/rbi.rb
163
164
  - lib/rbs/prototype/runtime.rb
@@ -173,6 +174,7 @@ files:
173
174
  - lib/rbs/test/tester.rb
174
175
  - lib/rbs/test/type_check.rb
175
176
  - lib/rbs/type_alias_dependency.rb
177
+ - lib/rbs/type_alias_regularity.rb
176
178
  - lib/rbs/type_name.rb
177
179
  - lib/rbs/type_name_resolver.rb
178
180
  - lib/rbs/types.rb
@@ -181,7 +183,6 @@ files:
181
183
  - lib/rbs/vendorer.rb
182
184
  - lib/rbs/version.rb
183
185
  - lib/rbs/writer.rb
184
- - lib/ruby/signature.rb
185
186
  - rbs.gemspec
186
187
  - schema/annotation.json
187
188
  - schema/comment.json
@@ -225,6 +226,7 @@ files:
225
226
  - sig/repository.rbs
226
227
  - sig/substitution.rbs
227
228
  - sig/type_alias_dependency.rbs
229
+ - sig/type_alias_regularity.rbs
228
230
  - sig/type_name_resolver.rbs
229
231
  - sig/typename.rbs
230
232
  - sig/types.rbs
@@ -340,9 +342,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
340
342
  version: '2.6'
341
343
  required_rubygems_version: !ruby/object:Gem::Requirement
342
344
  requirements:
343
- - - ">"
345
+ - - ">="
344
346
  - !ruby/object:Gem::Version
345
- version: 1.3.1
347
+ version: '0'
346
348
  requirements: []
347
349
  rubygems_version: 3.2.22
348
350
  signing_key: