rbs 3.9.0.pre.1 → 3.9.0.pre.2

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: dfc16707bf516d2296468a341b413fd87a4ecb032b8fb54717fa36ffe6310d10
4
- data.tar.gz: ecbf8ac797a87c14b34aa0e78bf7c7c708762bc5048c16230f5d2bf23d38f981
3
+ metadata.gz: e4c12dc48aff1dbea42a5a3b744a3f4c60ec4636ff31254abbba54edff3b3e1d
4
+ data.tar.gz: 69aa96a394191b63d825071352e35221534925980e13001e83dce553efa458d2
5
5
  SHA512:
6
- metadata.gz: c8f881cc73012ba92d79512a934c1d75fe879e0de1b03e44286d4288414cf7678b5d5cf1319718765c6457136fc1a72ce435fe8392fc186abdd3d712f4662d6e
7
- data.tar.gz: e724bc074e0ac9e3cd46e8eb40ad6b0837a31820786d924bc4e79760946f55cf0ad8d7ca7ca2bee97ca9ad98ef5c4671e9df0dee4ece85f636f72ebd8787a85d
6
+ metadata.gz: '0875e68b5e75f08901125ae81e186979822fb6eca9e50bac68bcd78b7b379b004407c490833a885ed6d931353b3f53dd5509a854c57781659cc9f2c78bff6843'
7
+ data.tar.gz: 7fbc423409626a355aebc89d4c7dfd99bb81b3e522f3e443f43448b145508f367bab2d68d432aa4248e5029640b61ac79ab55af489f01f9249a0d5c30affa108
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.9.0.pre.2 (2025-03-14)
4
+
5
+ ### Signature updates
6
+
7
+ * `Hash.new` type ([#2323](https://github.com/ruby/rbs/pull/2323))
8
+ * `Module#define_method` ([#2325](https://github.com/ruby/rbs/pull/2325))
9
+ * `Object#define_singleton_method` ([#2324](https://github.com/ruby/rbs/pull/2324))
10
+
11
+ ### Language updates
12
+
13
+ * Fix `define_method` method block self type ([#2325](https://github.com/ruby/rbs/pull/2325))
14
+
3
15
  ## 3.9.0.pre.1 (2025-03-11)
4
16
 
5
17
  ### 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
- | [V] (V default, ?capacity: int) -> void
1849
- | [A, B] (?capacity: int) { (Hash[A, B] hash, A key) -> B } -> void
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
@@ -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: self] -> untyped | Method | UnboundMethod method) -> Symbol
735
- | (interned symbol) { () [self: self] -> untyped } -> Symbol
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
@@ -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(&params)) {
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(&params)) {
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/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBS
4
- VERSION = "3.9.0.pre.1"
4
+ VERSION = "3.9.0.pre.2"
5
5
  end
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.pre.1
4
+ version: 3.9.0.pre.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-11 00:00:00.000000000 Z
10
+ date: 2025-03-14 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: logger