sorbet-runtime 0.5.11690 → 0.5.12067

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: 1eabb6464fcf1f72f15ae3e3578c1255742b5dd9ce9aa0a9a0a3e5c822d37f46
4
- data.tar.gz: 732602662682d9844f28a8bb1b950750cb2ece4cc27f4f3f3bd857d8a5f02b4c
3
+ metadata.gz: 9cabf74bc5ad63d319702fb59f0df2d8b4b15b82f7c3a2e17d45b5ff338874ef
4
+ data.tar.gz: b774dd7d82539b635ac56d49a029d0cb6c0239f5a3a2617df1e0ba95de25fdc5
5
5
  SHA512:
6
- metadata.gz: 2b0c2fa93298f6867939c00b85d8c81559e76603b84283dc3e939e78cb9346ef232e3923f96fb30e42e49832ea573e5ab52973db30443d1cd3b51968d1f634c3
7
- data.tar.gz: 0e42047f61a3648af4a4e4e93485410263ee096f5e87060b817bfac14d91deda3d96f47efb2c052bac7b1d4f852bda417bf24f48f385d9612ef29bfe9f5de182
6
+ metadata.gz: 75bf5bcdff9c96856a9a44e1647018c12a6010a7ecdb802e0d0cfc37d545a5407ac676b754947b07077a1e59cfa18d0c09a1bee3f2de9d2de444dae6ed7f220e
7
+ data.tar.gz: e63fce326fe421d2f28811a7d770a546630bc056ecd125bd92e3de093953243a1a8d348fb9d0afdc554a54dc3051d74209bf29c02245019ce0a0fa7034e4d5f6
@@ -46,21 +46,25 @@ module T::Private::Methods::CallValidation
46
46
  end
47
47
 
48
48
  def self.create_abstract_wrapper(mod, method_sig, original_method, original_visibility)
49
- mod.module_eval(<<~METHOD, __FILE__, __LINE__ + 1)
50
- #{original_visibility}
51
-
52
- def #{method_sig.method_name}(...)
53
- # We allow abstract methods to be implemented by things further down the ancestor chain.
54
- # So, if a super method exists, call it.
55
- if defined?(super)
56
- super
57
- else
58
- raise NotImplementedError.new(
59
- "The method `#{method_sig.method_name}` on #{mod} is declared as `abstract`. It does not have an implementation."
60
- )
61
- end
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
62
66
  end
63
- METHOD
67
+ end
64
68
  end
65
69
 
66
70
  def self.create_validator_method(mod, original_method, method_sig, original_visibility)
@@ -22,14 +22,14 @@ module T::Private::Sealed
22
22
  module NoIncludeExtend
23
23
  def included(child)
24
24
  super
25
- caller_loc = T::Private::CallerUtils.find_caller {|loc| !loc.to_s.match(/in `included'$/)}
25
+ caller_loc = T::Private::CallerUtils.find_caller {|loc| loc.base_label != 'included'}
26
26
  T::Private::Sealed.validate_inheritance(caller_loc, self, child, 'included')
27
27
  @sorbet_sealed_module_all_subclasses << child
28
28
  end
29
29
 
30
30
  def extended(child)
31
31
  super
32
- caller_loc = T::Private::CallerUtils.find_caller {|loc| !loc.to_s.match(/in `extended'$/)}
32
+ caller_loc = T::Private::CallerUtils.find_caller {|loc| loc.base_label != 'extended'}
33
33
  T::Private::Sealed.validate_inheritance(caller_loc, self, child, 'extended')
34
34
  @sorbet_sealed_module_all_subclasses << child
35
35
  end
@@ -397,8 +397,9 @@ class T::Props::Decorator
397
397
  T::Configuration.without_ruby_warnings do
398
398
  if !rules[:immutable]
399
399
  if method(:prop_set).owner != T::Props::Decorator
400
+ d = @class.decorator
400
401
  @class.send(:define_method, "#{name}=") do |val|
401
- T.unsafe(self.class).decorator.prop_set(self, name, val, rules)
402
+ d.prop_set(self, name, val, rules)
402
403
  end
403
404
  else
404
405
  # Fast path (~4x faster as of Ruby 2.6)
@@ -407,8 +408,9 @@ class T::Props::Decorator
407
408
  end
408
409
 
409
410
  if method(:prop_get).owner != T::Props::Decorator || rules.key?(:ifunset)
411
+ d = @class.decorator
410
412
  @class.send(:define_method, name) do
411
- T.unsafe(self.class).decorator.prop_get(self, name, rules)
413
+ d.prop_get(self, name, rules)
412
414
  end
413
415
  else
414
416
  # Fast path (~30x faster as of Ruby 2.6)
@@ -21,14 +21,14 @@ module T::Types
21
21
 
22
22
  # overrides Base
23
23
  def valid?(obj)
24
- obj.is_a?(Module) && (obj <= @type || false)
24
+ obj.is_a?(@type.singleton_class)
25
25
  end
26
26
 
27
27
  # overrides Base
28
28
  def subtype_of_single?(other)
29
29
  case other
30
30
  when ClassOf
31
- @type <= other.type
31
+ @type.is_a?(other.type.singleton_class)
32
32
  when Simple
33
33
  @type.is_a?(other.raw_type)
34
34
  when TypedClass
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.11690
4
+ version: 0.5.12067
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-07 00:00:00.000000000 Z
11
+ date: 2025-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest