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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f78b675f663d8fde05a0f094b4ad2b63291d5df4468f43fc26517f464bdb4d5a
4
- data.tar.gz: 0a41edf382b774592d67b7bdc9a933d1b4b266086b62753c39b482a6b8012a3c
3
+ metadata.gz: f90000891f13d57d27beb58a5176f5ff595e58628c51982dc18d985796bbb90d
4
+ data.tar.gz: 7f70e0544fa9c1b1312f1d4f0da5da4fa448bb651ced22f92bc8a6332507d501
5
5
  SHA512:
6
- metadata.gz: 909a36fac1812760c1060e2320a64ff5949e40b8796a501359e565e83f8dab35b7ae8fbd78da91d437d1178bb22bdc173dbcc865288f9ea1047723e99c444e5a
7
- data.tar.gz: 5ef6bd3a7e7709ebb2ca27c60c337b6618ae0cb9044df39446cb0ba56bf460e8f7656801302bc815988169a580e6aa162c1aac2236ca3e5ccf5d80e9e850092e
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
@@ -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
- #ifdef __clang__
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBS
4
- VERSION = "4.1.2"
4
+ VERSION = "4.1.3"
5
5
  end
@@ -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.2
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.17
652
+ rubygems_version: 4.0.18
653
653
  specification_version: 4
654
654
  summary: Type signature for Ruby.
655
655
  test_files: []