rbs 4.1.2 → 4.1.3
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 +7 -0
- data/include/rbs/defines.h +6 -1
- data/lib/rbs/unit_test/type_assertions.rb +5 -5
- data/lib/rbs/version.rb +1 -1
- data/sig/unit_test/type_assertions.rbs +2 -2
- 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: f90000891f13d57d27beb58a5176f5ff595e58628c51982dc18d985796bbb90d
|
|
4
|
+
data.tar.gz: 7f70e0544fa9c1b1312f1d4f0da5da4fa448bb651ced22f92bc8a6332507d501
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b69502540c88356e2a22e89fe9931fe873421510b64004e7aec332cdb3393a0e75b72cdab2462f020efd9f3bd8b7d5b18b48b53b6ec133c09823c8c518e4536
|
|
7
|
+
data.tar.gz: 4598739801a2982e9517e34f11d64ab367a6cf70346866f8937fc44cf7496d4fc099b64510d966fc01c007421e63b07c5de59f17a33fa4140af0f5aa3f0a9193
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 4.1.3 (2026-08-10)
|
|
4
|
+
|
|
5
|
+
### Miscellaneous
|
|
6
|
+
|
|
7
|
+
* Don't use Clang nullability qualifiers in strict ISO C mode ([#3074](https://github.com/ruby/rbs/pull/3074), Backported in [#3075](https://github.com/ruby/rbs/pull/3075))
|
|
8
|
+
* Avoid eagerly inspecting call traces in type assertions ([#3073](https://github.com/ruby/rbs/pull/3073), Backported in [#3076](https://github.com/ruby/rbs/pull/3076))
|
|
9
|
+
|
|
3
10
|
## 4.1.2 (2026-08-03)
|
|
4
11
|
|
|
5
12
|
### Miscellaneous
|
data/include/rbs/defines.h
CHANGED
|
@@ -87,8 +87,13 @@
|
|
|
87
87
|
* Nullability annotations for pointer types.
|
|
88
88
|
* Clang supports _Nullable and _Nonnull to indicate whether a pointer may be NULL.
|
|
89
89
|
* On other compilers, these expand to nothing.
|
|
90
|
+
*
|
|
91
|
+
* They are Clang extensions, so a strict ISO C compilation rejects them with
|
|
92
|
+
* `-Wnullability-extension`, which is an error under `-pedantic-errors`. Expand
|
|
93
|
+
* them to nothing in that case, so that embedders compiling these headers with a
|
|
94
|
+
* conforming dialect (`-std=c99` and friends define `__STRICT_ANSI__`) still build.
|
|
90
95
|
*/
|
|
91
|
-
#
|
|
96
|
+
#if defined(__clang__) && !defined(__STRICT_ANSI__)
|
|
92
97
|
#define RBS_NULLABLE _Nullable
|
|
93
98
|
#define RBS_NONNULL _Nonnull
|
|
94
99
|
#else
|
|
@@ -180,11 +180,11 @@ module RBS
|
|
|
180
180
|
)
|
|
181
181
|
errors = typecheck.method_call(method, method_type, trace, errors: [])
|
|
182
182
|
|
|
183
|
-
assert_empty errors.map {|x| RBS::Test::Errors.to_string(x) }, "Call trace does not match with given method type: #{trace.inspect}"
|
|
183
|
+
assert_empty errors.map {|x| RBS::Test::Errors.to_string(x) }, -> { "Call trace does not match with given method type: #{trace.inspect}" }
|
|
184
184
|
|
|
185
185
|
method_defs = method_defs(method)
|
|
186
186
|
all_errors = method_defs.map {|t| typecheck.method_call(method, t.type, trace, errors: [], annotations: t.each_annotation.to_a) }
|
|
187
|
-
assert all_errors.any? {|es| es.empty? }, "Call trace does not match one of method definitions:\n #{trace.inspect}\n #{method_defs.map(&:type).join(" | ")}"
|
|
187
|
+
assert all_errors.any? {|es| es.empty? }, -> { "Call trace does not match one of method definitions:\n #{trace.inspect}\n #{method_defs.map(&:type).join(" | ")}" }
|
|
188
188
|
|
|
189
189
|
raise exception if exception
|
|
190
190
|
|
|
@@ -204,11 +204,11 @@ module RBS
|
|
|
204
204
|
)
|
|
205
205
|
errors = typecheck.method_call(method, method_type, trace, errors: [])
|
|
206
206
|
|
|
207
|
-
assert_empty errors.map {|x| RBS::Test::Errors.to_string(x) }, "Call trace does not match with given method type: #{trace.inspect}"
|
|
207
|
+
assert_empty errors.map {|x| RBS::Test::Errors.to_string(x) }, -> { "Call trace does not match with given method type: #{trace.inspect}" }
|
|
208
208
|
|
|
209
209
|
method_defs = method_defs(method)
|
|
210
210
|
all_errors = method_defs.map {|t| typecheck.method_call(method, t.type, trace, errors: [], annotations: t.each_annotation.to_a) }
|
|
211
|
-
assert all_errors.any? {|es| es.empty? }, "Call trace does not match one of method definitions:\n #{trace.inspect}\n #{method_defs.map(&:type).join(" | ")}"
|
|
211
|
+
assert all_errors.any? {|es| es.empty? }, -> { "Call trace does not match one of method definitions:\n #{trace.inspect}\n #{method_defs.map(&:type).join(" | ")}" }
|
|
212
212
|
|
|
213
213
|
# Use `instnace_of?` instead of `is_a?` as we want to check for _the exact exception class_.
|
|
214
214
|
assert exception.instance_of? error_type
|
|
@@ -246,7 +246,7 @@ module RBS
|
|
|
246
246
|
|
|
247
247
|
method_defs = method_defs(method)
|
|
248
248
|
all_errors = method_defs.map {|t| typecheck.method_call(method, t.type, trace, errors: [], annotations: t.each_annotation.to_a) }
|
|
249
|
-
assert all_errors.all? {|es| es.size > 0 }, "Call trace unexpectedly matches one of method definitions:\n #{trace.inspect}\n #{method_defs.map(&:type).join(" | ")}"
|
|
249
|
+
assert all_errors.all? {|es| es.size > 0 }, -> { "Call trace unexpectedly matches one of method definitions:\n #{trace.inspect}\n #{method_defs.map(&:type).join(" | ")}" }
|
|
250
250
|
|
|
251
251
|
result
|
|
252
252
|
end
|
data/lib/rbs/version.rb
CHANGED
|
@@ -30,11 +30,11 @@ module RBS
|
|
|
30
30
|
type target_type = Types::ClassInstance | Types::ClassSingleton
|
|
31
31
|
|
|
32
32
|
interface _BaseAssertions
|
|
33
|
-
def assert: (untyped, ?String?) -> void
|
|
33
|
+
def assert: (untyped, ?(String | ^() -> String)?) -> void
|
|
34
34
|
|
|
35
35
|
def refute: (untyped, ?String?) -> void
|
|
36
36
|
|
|
37
|
-
def assert_empty: (untyped, ?String?) -> void
|
|
37
|
+
def assert_empty: (untyped, ?(String | ^() -> String)?) -> void
|
|
38
38
|
|
|
39
39
|
def assert_operator: (untyped, Symbol, *untyped) -> void
|
|
40
40
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rbs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.1.
|
|
4
|
+
version: 4.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Soutaro Matsumoto
|
|
@@ -649,7 +649,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
649
649
|
- !ruby/object:Gem::Version
|
|
650
650
|
version: '0'
|
|
651
651
|
requirements: []
|
|
652
|
-
rubygems_version: 4.0.
|
|
652
|
+
rubygems_version: 4.0.18
|
|
653
653
|
specification_version: 4
|
|
654
654
|
summary: Type signature for Ruby.
|
|
655
655
|
test_files: []
|