rbs 3.9.0.pre.1 → 3.9.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/core/hash.rbs +2 -2
- data/core/kernel.rbs +2 -2
- data/core/module.rbs +3 -3
- data/core/object.rbs +1 -1
- data/core/string.rbs +2 -2
- data/ext/rbs_extension/parser.c +7 -7
- data/lib/rbs/ast/type_param.rb +0 -10
- data/lib/rbs/prototype/rb.rb +2 -1
- data/lib/rbs/prototype/rbi.rb +2 -1
- data/lib/rbs/prototype/runtime.rb +3 -0
- data/lib/rbs/types.rb +3 -7
- data/lib/rbs/unit_test/with_aliases.rb +3 -1
- data/lib/rbs/version.rb +1 -1
- data/sig/annotate/rdoc_source.rbs +2 -0
- data/sig/cli.rbs +2 -0
- data/sig/namespace.rbs +1 -1
- data/sig/typename.rbs +1 -1
- data/sig/types.rbs +0 -3
- data/stdlib/net-http/0/net-http.rbs +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99881d9d6dc3248787fcd06f704731455c6a295f040dea8f325b6d4575906de0
|
4
|
+
data.tar.gz: fbb1b6add7b4bba7469e9e33cddecf88d4b566517f385869d7878de519538579
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3c303d4e3e34b75e5041a42050891868fc52f6a6f66dec8877b56adaef5d039045029e7210e7d597ab7f88f5ec52862437cdbc18e8c0e086b4810559a05b643
|
7
|
+
data.tar.gz: 0b0de8c8ba60b21b53f6e66004afe2519bb34f9c535d54636bc3f4b0772c67f62b7a09399ba88e1df84b482be75601380105a0bad89b3613e2896d158672a648
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 3.9.0 (2025-03-18)
|
4
|
+
|
5
|
+
### Miscellaneous
|
6
|
+
|
7
|
+
* Update steep ([#2328](https://github.com/ruby/rbs/pull/2328))
|
8
|
+
|
9
|
+
## 3.9.0.pre.2 (2025-03-14)
|
10
|
+
|
11
|
+
### Signature updates
|
12
|
+
|
13
|
+
* `Hash.new` type ([#2323](https://github.com/ruby/rbs/pull/2323))
|
14
|
+
* `Module#define_method` ([#2325](https://github.com/ruby/rbs/pull/2325))
|
15
|
+
* `Object#define_singleton_method` ([#2324](https://github.com/ruby/rbs/pull/2324))
|
16
|
+
|
17
|
+
### Language updates
|
18
|
+
|
19
|
+
* Fix `define_method` method block self type ([#2325](https://github.com/ruby/rbs/pull/2325))
|
20
|
+
|
3
21
|
## 3.9.0.pre.1 (2025-03-11)
|
4
22
|
|
5
23
|
### Signature updates
|
data/core/hash.rbs
CHANGED
@@ -1845,8 +1845,8 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
1845
1845
|
# be resized.
|
1846
1846
|
#
|
1847
1847
|
def initialize: (?capacity: int) -> void
|
1848
|
-
|
|
1849
|
-
|
|
1848
|
+
| (V default, ?capacity: int) -> void
|
1849
|
+
| (?capacity: int) { (Hash[K, V] hash, K key) -> V } -> void
|
1850
1850
|
|
1851
1851
|
# <!--
|
1852
1852
|
# rdoc-file=hash.c
|
data/core/kernel.rbs
CHANGED
@@ -1729,7 +1729,7 @@ module Kernel : BasicObject
|
|
1729
1729
|
def self?.sleep: (?nil) -> bot
|
1730
1730
|
| (Time::_Timeout duration) -> Integer
|
1731
1731
|
|
1732
|
-
%a{
|
1732
|
+
%a{deprecated}
|
1733
1733
|
interface _Divmod
|
1734
1734
|
def divmod: (Numeric) -> [ Numeric, Numeric ]
|
1735
1735
|
end
|
@@ -2297,7 +2297,7 @@ module Kernel : BasicObject
|
|
2297
2297
|
# chris.greet("Hi") #=> "Hi, I'm Chris!"
|
2298
2298
|
#
|
2299
2299
|
def define_singleton_method: (interned name, Method | UnboundMethod | Proc method) -> Symbol
|
2300
|
-
| (interned name) { (?) -> untyped } -> Symbol
|
2300
|
+
| (interned name) { (?) [self: self] -> untyped } -> Symbol
|
2301
2301
|
|
2302
2302
|
# <!--
|
2303
2303
|
# rdoc-file=io.c
|
data/core/module.rbs
CHANGED
@@ -731,8 +731,8 @@ class Module < Object
|
|
731
731
|
# I'm Dino!
|
732
732
|
# #<B:0x401b39e8>
|
733
733
|
#
|
734
|
-
def define_method: (interned symbol, ^() [self:
|
735
|
-
| (interned symbol) { () [self:
|
734
|
+
def define_method: (interned symbol, ^(?) [self: top] -> untyped | Method | UnboundMethod method) -> Symbol
|
735
|
+
| (interned symbol) { (?) [self: top] -> untyped } -> Symbol
|
736
736
|
|
737
737
|
# <!--
|
738
738
|
# rdoc-file=object.c
|
@@ -1699,6 +1699,6 @@ class Module < Object
|
|
1699
1699
|
def attr: (*interned arg0) -> Array[Symbol]
|
1700
1700
|
|
1701
1701
|
# A previous incarnation of `interned` for backward-compatibility (see #1499)
|
1702
|
-
%a{
|
1702
|
+
%a{deprecated: Use `interned`}
|
1703
1703
|
type id = interned
|
1704
1704
|
end
|
data/core/object.rbs
CHANGED
data/core/string.rbs
CHANGED
@@ -3574,10 +3574,10 @@ class String
|
|
3574
3574
|
def valid_encoding?: () -> bool
|
3575
3575
|
end
|
3576
3576
|
|
3577
|
-
%a{
|
3577
|
+
%a{deprecated}
|
3578
3578
|
interface _ArefFromStringToString
|
3579
3579
|
def []: (String) -> String
|
3580
3580
|
end
|
3581
3581
|
|
3582
|
-
%a{
|
3582
|
+
%a{deprecated}
|
3583
3583
|
type String::encode_fallback = Hash[String, String] | Proc | Method | _ArefFromStringToString
|
data/ext/rbs_extension/parser.c
CHANGED
@@ -661,16 +661,16 @@ static void parse_function(parserstate *state, VALUE *function, VALUE *block, VA
|
|
661
661
|
parser_advance_assert(state, pRPAREN);
|
662
662
|
}
|
663
663
|
|
664
|
-
// Untyped method parameter means it cannot have block
|
665
|
-
if (rbs_is_untyped_params(¶ms)) {
|
666
|
-
if (state->next_token.type != pARROW) {
|
667
|
-
raise_syntax_error(state, state->next_token2, "A method type with untyped method parameter cannot have block");
|
668
|
-
}
|
669
|
-
}
|
670
|
-
|
671
664
|
// Passing NULL to function_self_type means the function itself doesn't accept self type binding. (== method type)
|
672
665
|
if (function_self_type) {
|
673
666
|
*function_self_type = parse_self_type_binding(state);
|
667
|
+
} else {
|
668
|
+
// Parsing method type. untyped_params means it cannot have a block
|
669
|
+
if (rbs_is_untyped_params(¶ms)) {
|
670
|
+
if (state->next_token.type != pARROW) {
|
671
|
+
raise_syntax_error(state, state->next_token2, "A method type with untyped method parameter cannot have block");
|
672
|
+
}
|
673
|
+
}
|
674
674
|
}
|
675
675
|
|
676
676
|
VALUE required = Qtrue;
|
data/lib/rbs/ast/type_param.rb
CHANGED
@@ -56,16 +56,6 @@ module RBS
|
|
56
56
|
}.to_json(state)
|
57
57
|
end
|
58
58
|
|
59
|
-
def rename(name)
|
60
|
-
TypeParam.new(
|
61
|
-
name: name,
|
62
|
-
variance: variance,
|
63
|
-
upper_bound: upper_bound_type,
|
64
|
-
location: location,
|
65
|
-
default_type: default_type
|
66
|
-
).unchecked!(unchecked?)
|
67
|
-
end
|
68
|
-
|
69
59
|
def map_type(&block)
|
70
60
|
if b = upper_bound_type
|
71
61
|
_upper_bound_type = yield(b)
|
data/lib/rbs/prototype/rb.rb
CHANGED
data/lib/rbs/prototype/rbi.rb
CHANGED
@@ -250,6 +250,8 @@ module RBS
|
|
250
250
|
method = builder.build_singleton(module_name.absolute!).methods[singleton]
|
251
251
|
method_name = singleton
|
252
252
|
kind = :singleton
|
253
|
+
else
|
254
|
+
raise
|
253
255
|
end
|
254
256
|
|
255
257
|
if method
|
@@ -462,6 +464,7 @@ module RBS
|
|
462
464
|
name: to_type_name(name.to_s),
|
463
465
|
type: type,
|
464
466
|
location: nil,
|
467
|
+
annotations: [],
|
465
468
|
comment: nil
|
466
469
|
)
|
467
470
|
end
|
data/lib/rbs/types.rb
CHANGED
@@ -109,18 +109,14 @@ module RBS
|
|
109
109
|
class Any < Base
|
110
110
|
def initialize(location:, todo: false)
|
111
111
|
super(location: location)
|
112
|
-
|
112
|
+
if todo
|
113
|
+
@string = "__todo__"
|
114
|
+
end
|
113
115
|
end
|
114
116
|
|
115
117
|
def to_s(level=0)
|
116
118
|
@string || "untyped"
|
117
119
|
end
|
118
|
-
|
119
|
-
# @deprecated: this method is now called from the constructor, do not call it from outside
|
120
|
-
def todo!
|
121
|
-
@string = '__todo__'
|
122
|
-
self
|
123
|
-
end
|
124
120
|
end
|
125
121
|
class Nil < Base; end
|
126
122
|
class Top < Base; end
|
@@ -127,7 +127,9 @@ module RBS
|
|
127
127
|
|
128
128
|
# `Range` requires `begin <=> end` to return non-nil, but doesn't actually
|
129
129
|
# end up using the return value of it. This is to add that in when needed.
|
130
|
-
|
130
|
+
unless defined? lower.<=>
|
131
|
+
def lower.<=>(rhs) = :not_nil # steep:ignore MethodDefinitionInUndeclaredModule
|
132
|
+
end
|
131
133
|
|
132
134
|
# If `lower <=> rhs` is defined but nil, then that means we're going to be constructing
|
133
135
|
# an illegal range (eg `3..ToInt.new(4)`). So, we need to skip yielding an invalid range
|
data/lib/rbs/version.rb
CHANGED
@@ -25,6 +25,8 @@ module RBS
|
|
25
25
|
| (TypeName, singleton_method: Symbol) -> Array[RDoc::AnyMethod]?
|
26
26
|
|
27
27
|
def find_attribute: (TypeName, Symbol, singleton: bool) -> Array[RDoc::Attr]?
|
28
|
+
|
29
|
+
def class_docs: (TypeName) -> Array[::RDoc::Markup::Document | ::RDoc::Comment | ::String]?
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
data/sig/cli.rbs
CHANGED
data/sig/namespace.rbs
CHANGED
data/sig/typename.rbs
CHANGED
data/sig/types.rbs
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.0
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-18 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: logger
|