sorbet-runtime 0.5.11600 → 0.5.11882

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: ad1c9046dd6aa07339926f8c5e7a9a042dfee669606201b598c96738746324c0
4
- data.tar.gz: adb33d1b984655c074df31baf75d1c92583a76117cfa67c432ea94e63a55fea5
3
+ metadata.gz: eeae0b9bfa2deb866c0dd5e33eb858c3acfc5fedc10252fd1163ff78d5717a67
4
+ data.tar.gz: 88ff6a8dae63d5d6c3f0ac89637da535e410e42823003525523bff9992e4ee47
5
5
  SHA512:
6
- metadata.gz: 92cf5dc0b78130f3cec00c593bf83708ad96a929de0009a7227bb4411cc4a4625a95d89b30b0a8b22c534c7bf926a75f7d2764b99db58c6bda8af3f961b3a999
7
- data.tar.gz: 24bd3de465b1850094612d3115a0d62a1ac744c19980274341cb7b287ef86e380c6a32878820557115d69640434bd4ad22356b092647ebcfdbf8be610aa7e1ff
6
+ metadata.gz: ccc92bda101f8ba7e3743b7534fb64db250cc10986d15cbac92923657c3b48ae45f445a664c79a8c19b11d24855852b55c5429218dc4ec8a29e9087e33f8bb73
7
+ data.tar.gz: 701318c9165defdd480ec6263af80375c97e7c515243b069917ab400d30e5f6b2352014b5bf29e3a3d614c7aa7d6f65a202f5635249dd34306b2465095b2c775
@@ -14,17 +14,7 @@ module T::Private::Methods::CallValidation
14
14
  def self.wrap_method_if_needed(mod, method_sig, original_method)
15
15
  original_visibility = visibility_method_name(mod, method_sig.method_name)
16
16
  if method_sig.mode == T::Private::Methods::Modes.abstract
17
- T::Private::ClassUtils.replace_method(mod, method_sig.method_name, true) do |*args, &blk|
18
- # We allow abstract methods to be implemented by things further down the ancestor chain.
19
- # So, if a super method exists, call it.
20
- if defined?(super)
21
- super(*args, &blk)
22
- else
23
- raise NotImplementedError.new(
24
- "The method `#{method_sig.method_name}` on #{mod} is declared as `abstract`. It does not have an implementation."
25
- )
26
- end
27
- end
17
+ create_abstract_wrapper(mod, method_sig, original_method, original_visibility)
28
18
  # Do nothing in this case; this method was not wrapped in _on_method_added.
29
19
  elsif method_sig.defined_raw
30
20
  # Note, this logic is duplicated (intentionally, for micro-perf) at `Methods._on_method_added`,
@@ -55,6 +45,28 @@ module T::Private::Methods::CallValidation
55
45
  @is_allowed_to_have_fast_path = false
56
46
  end
57
47
 
48
+ def self.create_abstract_wrapper(mod, method_sig, original_method, original_visibility)
49
+ T::Configuration.without_ruby_warnings do
50
+ T::Private::DeclState.current.without_on_method_added do
51
+ mod.module_eval(<<~METHOD, __FILE__, __LINE__ + 1)
52
+ #{original_visibility}
53
+
54
+ def #{method_sig.method_name}(...)
55
+ # We allow abstract methods to be implemented by things further down the ancestor chain.
56
+ # So, if a super method exists, call it.
57
+ if defined?(super)
58
+ super
59
+ else
60
+ raise NotImplementedError.new(
61
+ "The method `#{method_sig.method_name}` on #{mod} is declared as `abstract`. It does not have an implementation."
62
+ )
63
+ end
64
+ end
65
+ METHOD
66
+ end
67
+ end
68
+ end
69
+
58
70
  def self.create_validator_method(mod, original_method, method_sig, original_visibility)
59
71
  has_fixed_arity = method_sig.kwarg_types.empty? && !method_sig.has_rest && !method_sig.has_keyrest &&
60
72
  original_method.parameters.all? {|(kind, _name)| kind == :req || kind == :block}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11600
4
+ version: 0.5.11882
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-08 00:00:00.000000000 Z
11
+ date: 2025-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest