sorbet-runtime 0.5.10285 → 0.5.10313

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf504bc3706374b9a6550a6466c266798160a6a0f8cbca181d44b58959850565
4
- data.tar.gz: a5ba45414d2838416efdb052a4350f5a0a62723ac42686e8f112c9676fdd82b6
3
+ metadata.gz: c6e836e361ea5528bbebac69456b42fe267d3b7ab673fc94e1adaa5c4410010b
4
+ data.tar.gz: 68f65dd51c902b3a50751db4cfdde2fdb8e6be80ed56e30c51e097161ee49c8b
5
5
  SHA512:
6
- metadata.gz: a4f0099deedbe90e8b2353250e5ff64d522f1dca8e108c885ddd6a5994bd8f2cddbc21bff1406dff1fa4ac6f16a64bee4f698ab7dd03a7acffbcf16d5f6fafdf
7
- data.tar.gz: d08d51b3401c667312325127af357b5ee7b5f9d853bbcb730385fd4a739aa2e797fdb8258a7202d7bd10860575ac73354c08d07875e79a6b1bfde90f5d267c91
6
+ metadata.gz: 161696e57710968306eeb14044f3539bdefa5e04e9459d0225fb4f1d9ce333e7ab6af5204a7922362844728c045be9f7c3cb616a48d30ab4be00f675d5c8e6b5
7
+ data.tar.gz: ff05d06ef8f54666298bcd9259c8cc56690848cc00a26f6479fdab41050a77649bb948a74ab07e10540d0f5ceb836d545a12fa26e3a92d0c34a9a7086949159e
@@ -69,6 +69,27 @@ module T::Private::ClassUtils
69
69
  end
70
70
  end
71
71
 
72
+ def self.def_with_visibility(mod, name, visibility, method=nil, &block)
73
+ mod.module_exec do
74
+ # Start a visibility (public/protected/private) region, so that
75
+ # all of the method redefinitions happen with the right visibility
76
+ # from the beginning. This ensures that any other code that is
77
+ # triggered by `method_added`, sees the redefined method with the
78
+ # right visibility.
79
+ send(visibility)
80
+
81
+ if method
82
+ define_method(name, method)
83
+ else
84
+ define_method(name, &block)
85
+ end
86
+
87
+ if block && block.arity < 0 && respond_to?(:ruby2_keywords, true)
88
+ ruby2_keywords(name)
89
+ end
90
+ end
91
+ end
92
+
72
93
  # Replaces a method, either by overwriting it (if it is defined directly on `mod`) or by
73
94
  # overriding it (if it is defined by one of mod's ancestors). Returns a ReplacedMethod instance
74
95
  # on which you can call `bind(...).call(...)` to call the original method, or `restore` to
@@ -96,13 +117,9 @@ module T::Private::ClassUtils
96
117
  overwritten = original_owner == mod
97
118
  T::Configuration.without_ruby_warnings do
98
119
  T::Private::DeclState.current.without_on_method_added do
99
- mod.send(:define_method, name, &blk)
100
- if blk.arity < 0 && mod.respond_to?(:ruby2_keywords, true)
101
- mod.send(:ruby2_keywords, name)
102
- end
120
+ def_with_visibility(mod, name, original_visibility, &blk)
103
121
  end
104
122
  end
105
- mod.send(original_visibility, name)
106
123
  new_method = mod.instance_method(name)
107
124
 
108
125
  ReplacedMethod.new(mod, original_method, new_method, overwritten, original_visibility)
@@ -40,9 +40,8 @@ module T::Private::Methods::CallValidation
40
40
  T::Configuration.without_ruby_warnings do
41
41
  # get all the shims out of the way and put back the original method
42
42
  T::Private::DeclState.current.without_on_method_added do
43
- mod.send(:define_method, method_sig.method_name, original_method)
43
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility, original_method)
44
44
  end
45
- mod.send(original_visibility, method_sig.method_name)
46
45
  end
47
46
  end
48
47
  # Return the newly created method (or the original one if we didn't replace it)
@@ -70,28 +69,25 @@ module T::Private::Methods::CallValidation
70
69
  T::Configuration.without_ruby_warnings do
71
70
  T::Private::DeclState.current.without_on_method_added do
72
71
  if simple_method
73
- create_validator_method_fast(mod, original_method, method_sig)
72
+ create_validator_method_fast(mod, original_method, method_sig, original_visibility)
74
73
  elsif simple_procedure
75
- create_validator_procedure_fast(mod, original_method, method_sig)
74
+ create_validator_procedure_fast(mod, original_method, method_sig, original_visibility)
76
75
  elsif ok_for_fast_path && method_sig.return_type.is_a?(T::Private::Types::Void)
77
- create_validator_procedure_medium(mod, original_method, method_sig)
76
+ create_validator_procedure_medium(mod, original_method, method_sig, original_visibility)
78
77
  elsif ok_for_fast_path
79
- create_validator_method_medium(mod, original_method, method_sig)
78
+ create_validator_method_medium(mod, original_method, method_sig, original_visibility)
80
79
  else
81
- create_validator_slow(mod, original_method, method_sig)
80
+ create_validator_slow(mod, original_method, method_sig, original_visibility)
82
81
  end
83
82
  end
83
+ mod.send(original_visibility, method_sig.method_name)
84
84
  end
85
- mod.send(original_visibility, method_sig.method_name)
86
85
  end
87
86
 
88
- def self.create_validator_slow(mod, original_method, method_sig)
89
- mod.send(:define_method, method_sig.method_name) do |*args, &blk|
87
+ def self.create_validator_slow(mod, original_method, method_sig, original_visibility)
88
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |*args, &blk|
90
89
  CallValidation.validate_call(self, original_method, method_sig, args, blk)
91
90
  end
92
- if mod.respond_to?(:ruby2_keywords, true)
93
- mod.send(:ruby2_keywords, method_sig.method_name)
94
- end
95
91
  end
96
92
 
97
93
  def self.validate_call(instance, original_method, method_sig, args, blk)
@@ -6,27 +6,27 @@
6
6
  # bazel test //gems/sorbet-runtime:update_call_validation
7
7
 
8
8
  module T::Private::Methods::CallValidation
9
- def self.create_validator_method_fast(mod, original_method, method_sig)
9
+ def self.create_validator_method_fast(mod, original_method, method_sig, original_visibility)
10
10
  if method_sig.return_type.is_a?(T::Private::Types::Void)
11
11
  raise 'Should have used create_validator_procedure_fast'
12
12
  end
13
13
  # trampoline to reduce stack frame size
14
14
  if method_sig.arg_types.empty?
15
- create_validator_method_fast0(mod, original_method, method_sig, method_sig.return_type.raw_type)
15
+ create_validator_method_fast0(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type)
16
16
  elsif method_sig.arg_types.length == 1
17
- create_validator_method_fast1(mod, original_method, method_sig, method_sig.return_type.raw_type,
17
+ create_validator_method_fast1(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type,
18
18
  method_sig.arg_types[0][1].raw_type)
19
19
  elsif method_sig.arg_types.length == 2
20
- create_validator_method_fast2(mod, original_method, method_sig, method_sig.return_type.raw_type,
20
+ create_validator_method_fast2(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type,
21
21
  method_sig.arg_types[0][1].raw_type,
22
22
  method_sig.arg_types[1][1].raw_type)
23
23
  elsif method_sig.arg_types.length == 3
24
- create_validator_method_fast3(mod, original_method, method_sig, method_sig.return_type.raw_type,
24
+ create_validator_method_fast3(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type,
25
25
  method_sig.arg_types[0][1].raw_type,
26
26
  method_sig.arg_types[1][1].raw_type,
27
27
  method_sig.arg_types[2][1].raw_type)
28
28
  elsif method_sig.arg_types.length == 4
29
- create_validator_method_fast4(mod, original_method, method_sig, method_sig.return_type.raw_type,
29
+ create_validator_method_fast4(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type,
30
30
  method_sig.arg_types[0][1].raw_type,
31
31
  method_sig.arg_types[1][1].raw_type,
32
32
  method_sig.arg_types[2][1].raw_type,
@@ -36,8 +36,8 @@ module T::Private::Methods::CallValidation
36
36
  end
37
37
  end
38
38
 
39
- def self.create_validator_method_fast0(mod, original_method, method_sig, return_type)
40
- mod.send(:define_method, method_sig.method_name) do |&blk|
39
+ def self.create_validator_method_fast0(mod, original_method, method_sig, original_visibility, return_type)
40
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |&blk|
41
41
  # This method is a manually sped-up version of more general code in `validate_call`
42
42
  # The following line breaks are intentional to show nice pry message
43
43
 
@@ -73,8 +73,8 @@ module T::Private::Methods::CallValidation
73
73
  end
74
74
  end
75
75
 
76
- def self.create_validator_method_fast1(mod, original_method, method_sig, return_type, arg0_type)
77
- mod.send(:define_method, method_sig.method_name) do |arg0, &blk|
76
+ def self.create_validator_method_fast1(mod, original_method, method_sig, original_visibility, return_type, arg0_type)
77
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, &blk|
78
78
  # This method is a manually sped-up version of more general code in `validate_call`
79
79
  unless arg0.is_a?(arg0_type)
80
80
  CallValidation.report_error(
@@ -122,8 +122,8 @@ module T::Private::Methods::CallValidation
122
122
  end
123
123
  end
124
124
 
125
- def self.create_validator_method_fast2(mod, original_method, method_sig, return_type, arg0_type, arg1_type)
126
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, &blk|
125
+ def self.create_validator_method_fast2(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type)
126
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, &blk|
127
127
  # This method is a manually sped-up version of more general code in `validate_call`
128
128
  unless arg0.is_a?(arg0_type)
129
129
  CallValidation.report_error(
@@ -183,8 +183,8 @@ module T::Private::Methods::CallValidation
183
183
  end
184
184
  end
185
185
 
186
- def self.create_validator_method_fast3(mod, original_method, method_sig, return_type, arg0_type, arg1_type, arg2_type)
187
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, &blk|
186
+ def self.create_validator_method_fast3(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type, arg2_type)
187
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, &blk|
188
188
  # This method is a manually sped-up version of more general code in `validate_call`
189
189
  unless arg0.is_a?(arg0_type)
190
190
  CallValidation.report_error(
@@ -256,8 +256,8 @@ module T::Private::Methods::CallValidation
256
256
  end
257
257
  end
258
258
 
259
- def self.create_validator_method_fast4(mod, original_method, method_sig, return_type, arg0_type, arg1_type, arg2_type, arg3_type)
260
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, arg3, &blk|
259
+ def self.create_validator_method_fast4(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type, arg2_type, arg3_type)
260
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, arg3, &blk|
261
261
  # This method is a manually sped-up version of more general code in `validate_call`
262
262
  unless arg0.is_a?(arg0_type)
263
263
  CallValidation.report_error(
@@ -341,24 +341,24 @@ module T::Private::Methods::CallValidation
341
341
  end
342
342
  end
343
343
 
344
- def self.create_validator_procedure_fast(mod, original_method, method_sig)
344
+ def self.create_validator_procedure_fast(mod, original_method, method_sig, original_visibility)
345
345
  # trampoline to reduce stack frame size
346
346
  if method_sig.arg_types.empty?
347
- create_validator_procedure_fast0(mod, original_method, method_sig)
347
+ create_validator_procedure_fast0(mod, original_method, method_sig, original_visibility)
348
348
  elsif method_sig.arg_types.length == 1
349
- create_validator_procedure_fast1(mod, original_method, method_sig,
349
+ create_validator_procedure_fast1(mod, original_method, method_sig, original_visibility,
350
350
  method_sig.arg_types[0][1].raw_type)
351
351
  elsif method_sig.arg_types.length == 2
352
- create_validator_procedure_fast2(mod, original_method, method_sig,
352
+ create_validator_procedure_fast2(mod, original_method, method_sig, original_visibility,
353
353
  method_sig.arg_types[0][1].raw_type,
354
354
  method_sig.arg_types[1][1].raw_type)
355
355
  elsif method_sig.arg_types.length == 3
356
- create_validator_procedure_fast3(mod, original_method, method_sig,
356
+ create_validator_procedure_fast3(mod, original_method, method_sig, original_visibility,
357
357
  method_sig.arg_types[0][1].raw_type,
358
358
  method_sig.arg_types[1][1].raw_type,
359
359
  method_sig.arg_types[2][1].raw_type)
360
360
  elsif method_sig.arg_types.length == 4
361
- create_validator_procedure_fast4(mod, original_method, method_sig,
361
+ create_validator_procedure_fast4(mod, original_method, method_sig, original_visibility,
362
362
  method_sig.arg_types[0][1].raw_type,
363
363
  method_sig.arg_types[1][1].raw_type,
364
364
  method_sig.arg_types[2][1].raw_type,
@@ -368,8 +368,8 @@ module T::Private::Methods::CallValidation
368
368
  end
369
369
  end
370
370
 
371
- def self.create_validator_procedure_fast0(mod, original_method, method_sig)
372
- mod.send(:define_method, method_sig.method_name) do |&blk|
371
+ def self.create_validator_procedure_fast0(mod, original_method, method_sig, original_visibility)
372
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |&blk|
373
373
  # This method is a manually sped-up version of more general code in `validate_call`
374
374
  # The following line breaks are intentional to show nice pry message
375
375
 
@@ -391,8 +391,8 @@ module T::Private::Methods::CallValidation
391
391
  end
392
392
  end
393
393
 
394
- def self.create_validator_procedure_fast1(mod, original_method, method_sig, arg0_type)
395
- mod.send(:define_method, method_sig.method_name) do |arg0, &blk|
394
+ def self.create_validator_procedure_fast1(mod, original_method, method_sig, original_visibility, arg0_type)
395
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, &blk|
396
396
  # This method is a manually sped-up version of more general code in `validate_call`
397
397
  unless arg0.is_a?(arg0_type)
398
398
  CallValidation.report_error(
@@ -426,8 +426,8 @@ module T::Private::Methods::CallValidation
426
426
  end
427
427
  end
428
428
 
429
- def self.create_validator_procedure_fast2(mod, original_method, method_sig, arg0_type, arg1_type)
430
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, &blk|
429
+ def self.create_validator_procedure_fast2(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type)
430
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, &blk|
431
431
  # This method is a manually sped-up version of more general code in `validate_call`
432
432
  unless arg0.is_a?(arg0_type)
433
433
  CallValidation.report_error(
@@ -473,8 +473,8 @@ module T::Private::Methods::CallValidation
473
473
  end
474
474
  end
475
475
 
476
- def self.create_validator_procedure_fast3(mod, original_method, method_sig, arg0_type, arg1_type, arg2_type)
477
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, &blk|
476
+ def self.create_validator_procedure_fast3(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type, arg2_type)
477
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, &blk|
478
478
  # This method is a manually sped-up version of more general code in `validate_call`
479
479
  unless arg0.is_a?(arg0_type)
480
480
  CallValidation.report_error(
@@ -532,8 +532,8 @@ module T::Private::Methods::CallValidation
532
532
  end
533
533
  end
534
534
 
535
- def self.create_validator_procedure_fast4(mod, original_method, method_sig, arg0_type, arg1_type, arg2_type, arg3_type)
536
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, arg3, &blk|
535
+ def self.create_validator_procedure_fast4(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type, arg2_type, arg3_type)
536
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, arg3, &blk|
537
537
  # This method is a manually sped-up version of more general code in `validate_call`
538
538
  unless arg0.is_a?(arg0_type)
539
539
  CallValidation.report_error(
@@ -603,27 +603,27 @@ module T::Private::Methods::CallValidation
603
603
  end
604
604
  end
605
605
 
606
- def self.create_validator_method_medium(mod, original_method, method_sig)
606
+ def self.create_validator_method_medium(mod, original_method, method_sig, original_visibility)
607
607
  if method_sig.return_type.is_a?(T::Private::Types::Void)
608
608
  raise 'Should have used create_validator_procedure_medium'
609
609
  end
610
610
  # trampoline to reduce stack frame size
611
611
  if method_sig.arg_types.empty?
612
- create_validator_method_medium0(mod, original_method, method_sig, method_sig.return_type)
612
+ create_validator_method_medium0(mod, original_method, method_sig, original_visibility, method_sig.return_type)
613
613
  elsif method_sig.arg_types.length == 1
614
- create_validator_method_medium1(mod, original_method, method_sig, method_sig.return_type,
614
+ create_validator_method_medium1(mod, original_method, method_sig, original_visibility, method_sig.return_type,
615
615
  method_sig.arg_types[0][1])
616
616
  elsif method_sig.arg_types.length == 2
617
- create_validator_method_medium2(mod, original_method, method_sig, method_sig.return_type,
617
+ create_validator_method_medium2(mod, original_method, method_sig, original_visibility, method_sig.return_type,
618
618
  method_sig.arg_types[0][1],
619
619
  method_sig.arg_types[1][1])
620
620
  elsif method_sig.arg_types.length == 3
621
- create_validator_method_medium3(mod, original_method, method_sig, method_sig.return_type,
621
+ create_validator_method_medium3(mod, original_method, method_sig, original_visibility, method_sig.return_type,
622
622
  method_sig.arg_types[0][1],
623
623
  method_sig.arg_types[1][1],
624
624
  method_sig.arg_types[2][1])
625
625
  elsif method_sig.arg_types.length == 4
626
- create_validator_method_medium4(mod, original_method, method_sig, method_sig.return_type,
626
+ create_validator_method_medium4(mod, original_method, method_sig, original_visibility, method_sig.return_type,
627
627
  method_sig.arg_types[0][1],
628
628
  method_sig.arg_types[1][1],
629
629
  method_sig.arg_types[2][1],
@@ -633,8 +633,8 @@ module T::Private::Methods::CallValidation
633
633
  end
634
634
  end
635
635
 
636
- def self.create_validator_method_medium0(mod, original_method, method_sig, return_type)
637
- mod.send(:define_method, method_sig.method_name) do |&blk|
636
+ def self.create_validator_method_medium0(mod, original_method, method_sig, original_visibility, return_type)
637
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |&blk|
638
638
  # This method is a manually sped-up version of more general code in `validate_call`
639
639
  # The following line breaks are intentional to show nice pry message
640
640
 
@@ -670,8 +670,8 @@ module T::Private::Methods::CallValidation
670
670
  end
671
671
  end
672
672
 
673
- def self.create_validator_method_medium1(mod, original_method, method_sig, return_type, arg0_type)
674
- mod.send(:define_method, method_sig.method_name) do |arg0, &blk|
673
+ def self.create_validator_method_medium1(mod, original_method, method_sig, original_visibility, return_type, arg0_type)
674
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, &blk|
675
675
  # This method is a manually sped-up version of more general code in `validate_call`
676
676
  unless arg0_type.valid?(arg0)
677
677
  CallValidation.report_error(
@@ -719,8 +719,8 @@ module T::Private::Methods::CallValidation
719
719
  end
720
720
  end
721
721
 
722
- def self.create_validator_method_medium2(mod, original_method, method_sig, return_type, arg0_type, arg1_type)
723
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, &blk|
722
+ def self.create_validator_method_medium2(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type)
723
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, &blk|
724
724
  # This method is a manually sped-up version of more general code in `validate_call`
725
725
  unless arg0_type.valid?(arg0)
726
726
  CallValidation.report_error(
@@ -780,8 +780,8 @@ module T::Private::Methods::CallValidation
780
780
  end
781
781
  end
782
782
 
783
- def self.create_validator_method_medium3(mod, original_method, method_sig, return_type, arg0_type, arg1_type, arg2_type)
784
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, &blk|
783
+ def self.create_validator_method_medium3(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type, arg2_type)
784
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, &blk|
785
785
  # This method is a manually sped-up version of more general code in `validate_call`
786
786
  unless arg0_type.valid?(arg0)
787
787
  CallValidation.report_error(
@@ -853,8 +853,8 @@ module T::Private::Methods::CallValidation
853
853
  end
854
854
  end
855
855
 
856
- def self.create_validator_method_medium4(mod, original_method, method_sig, return_type, arg0_type, arg1_type, arg2_type, arg3_type)
857
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, arg3, &blk|
856
+ def self.create_validator_method_medium4(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type, arg2_type, arg3_type)
857
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, arg3, &blk|
858
858
  # This method is a manually sped-up version of more general code in `validate_call`
859
859
  unless arg0_type.valid?(arg0)
860
860
  CallValidation.report_error(
@@ -938,24 +938,24 @@ module T::Private::Methods::CallValidation
938
938
  end
939
939
  end
940
940
 
941
- def self.create_validator_procedure_medium(mod, original_method, method_sig)
941
+ def self.create_validator_procedure_medium(mod, original_method, method_sig, original_visibility)
942
942
  # trampoline to reduce stack frame size
943
943
  if method_sig.arg_types.empty?
944
- create_validator_procedure_medium0(mod, original_method, method_sig)
944
+ create_validator_procedure_medium0(mod, original_method, method_sig, original_visibility)
945
945
  elsif method_sig.arg_types.length == 1
946
- create_validator_procedure_medium1(mod, original_method, method_sig,
946
+ create_validator_procedure_medium1(mod, original_method, method_sig, original_visibility,
947
947
  method_sig.arg_types[0][1])
948
948
  elsif method_sig.arg_types.length == 2
949
- create_validator_procedure_medium2(mod, original_method, method_sig,
949
+ create_validator_procedure_medium2(mod, original_method, method_sig, original_visibility,
950
950
  method_sig.arg_types[0][1],
951
951
  method_sig.arg_types[1][1])
952
952
  elsif method_sig.arg_types.length == 3
953
- create_validator_procedure_medium3(mod, original_method, method_sig,
953
+ create_validator_procedure_medium3(mod, original_method, method_sig, original_visibility,
954
954
  method_sig.arg_types[0][1],
955
955
  method_sig.arg_types[1][1],
956
956
  method_sig.arg_types[2][1])
957
957
  elsif method_sig.arg_types.length == 4
958
- create_validator_procedure_medium4(mod, original_method, method_sig,
958
+ create_validator_procedure_medium4(mod, original_method, method_sig, original_visibility,
959
959
  method_sig.arg_types[0][1],
960
960
  method_sig.arg_types[1][1],
961
961
  method_sig.arg_types[2][1],
@@ -965,8 +965,8 @@ module T::Private::Methods::CallValidation
965
965
  end
966
966
  end
967
967
 
968
- def self.create_validator_procedure_medium0(mod, original_method, method_sig)
969
- mod.send(:define_method, method_sig.method_name) do |&blk|
968
+ def self.create_validator_procedure_medium0(mod, original_method, method_sig, original_visibility)
969
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |&blk|
970
970
  # This method is a manually sped-up version of more general code in `validate_call`
971
971
  # The following line breaks are intentional to show nice pry message
972
972
 
@@ -988,8 +988,8 @@ module T::Private::Methods::CallValidation
988
988
  end
989
989
  end
990
990
 
991
- def self.create_validator_procedure_medium1(mod, original_method, method_sig, arg0_type)
992
- mod.send(:define_method, method_sig.method_name) do |arg0, &blk|
991
+ def self.create_validator_procedure_medium1(mod, original_method, method_sig, original_visibility, arg0_type)
992
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, &blk|
993
993
  # This method is a manually sped-up version of more general code in `validate_call`
994
994
  unless arg0_type.valid?(arg0)
995
995
  CallValidation.report_error(
@@ -1023,8 +1023,8 @@ module T::Private::Methods::CallValidation
1023
1023
  end
1024
1024
  end
1025
1025
 
1026
- def self.create_validator_procedure_medium2(mod, original_method, method_sig, arg0_type, arg1_type)
1027
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, &blk|
1026
+ def self.create_validator_procedure_medium2(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type)
1027
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, &blk|
1028
1028
  # This method is a manually sped-up version of more general code in `validate_call`
1029
1029
  unless arg0_type.valid?(arg0)
1030
1030
  CallValidation.report_error(
@@ -1070,8 +1070,8 @@ module T::Private::Methods::CallValidation
1070
1070
  end
1071
1071
  end
1072
1072
 
1073
- def self.create_validator_procedure_medium3(mod, original_method, method_sig, arg0_type, arg1_type, arg2_type)
1074
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, &blk|
1073
+ def self.create_validator_procedure_medium3(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type, arg2_type)
1074
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, &blk|
1075
1075
  # This method is a manually sped-up version of more general code in `validate_call`
1076
1076
  unless arg0_type.valid?(arg0)
1077
1077
  CallValidation.report_error(
@@ -1129,8 +1129,8 @@ module T::Private::Methods::CallValidation
1129
1129
  end
1130
1130
  end
1131
1131
 
1132
- def self.create_validator_procedure_medium4(mod, original_method, method_sig, arg0_type, arg1_type, arg2_type, arg3_type)
1133
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, arg3, &blk|
1132
+ def self.create_validator_procedure_medium4(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type, arg2_type, arg3_type)
1133
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, arg3, &blk|
1134
1134
  # This method is a manually sped-up version of more general code in `validate_call`
1135
1135
  unless arg0_type.valid?(arg0)
1136
1136
  CallValidation.report_error(
@@ -6,27 +6,27 @@
6
6
  # bazel test //gems/sorbet-runtime:update_call_validation
7
7
 
8
8
  module T::Private::Methods::CallValidation
9
- def self.create_validator_method_fast(mod, original_method, method_sig)
9
+ def self.create_validator_method_fast(mod, original_method, method_sig, original_visibility)
10
10
  if method_sig.return_type.is_a?(T::Private::Types::Void)
11
11
  raise 'Should have used create_validator_procedure_fast'
12
12
  end
13
13
  # trampoline to reduce stack frame size
14
14
  if method_sig.arg_types.empty?
15
- create_validator_method_fast0(mod, original_method, method_sig, method_sig.return_type.raw_type)
15
+ create_validator_method_fast0(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type)
16
16
  elsif method_sig.arg_types.length == 1
17
- create_validator_method_fast1(mod, original_method, method_sig, method_sig.return_type.raw_type,
17
+ create_validator_method_fast1(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type,
18
18
  method_sig.arg_types[0][1].raw_type)
19
19
  elsif method_sig.arg_types.length == 2
20
- create_validator_method_fast2(mod, original_method, method_sig, method_sig.return_type.raw_type,
20
+ create_validator_method_fast2(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type,
21
21
  method_sig.arg_types[0][1].raw_type,
22
22
  method_sig.arg_types[1][1].raw_type)
23
23
  elsif method_sig.arg_types.length == 3
24
- create_validator_method_fast3(mod, original_method, method_sig, method_sig.return_type.raw_type,
24
+ create_validator_method_fast3(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type,
25
25
  method_sig.arg_types[0][1].raw_type,
26
26
  method_sig.arg_types[1][1].raw_type,
27
27
  method_sig.arg_types[2][1].raw_type)
28
28
  elsif method_sig.arg_types.length == 4
29
- create_validator_method_fast4(mod, original_method, method_sig, method_sig.return_type.raw_type,
29
+ create_validator_method_fast4(mod, original_method, method_sig, original_visibility, method_sig.return_type.raw_type,
30
30
  method_sig.arg_types[0][1].raw_type,
31
31
  method_sig.arg_types[1][1].raw_type,
32
32
  method_sig.arg_types[2][1].raw_type,
@@ -36,8 +36,8 @@ module T::Private::Methods::CallValidation
36
36
  end
37
37
  end
38
38
 
39
- def self.create_validator_method_fast0(mod, original_method, method_sig, return_type)
40
- mod.send(:define_method, method_sig.method_name) do |&blk|
39
+ def self.create_validator_method_fast0(mod, original_method, method_sig, original_visibility, return_type)
40
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |&blk|
41
41
  # This method is a manually sped-up version of more general code in `validate_call`
42
42
  # The following line breaks are intentional to show nice pry message
43
43
 
@@ -73,8 +73,8 @@ module T::Private::Methods::CallValidation
73
73
  end
74
74
  end
75
75
 
76
- def self.create_validator_method_fast1(mod, original_method, method_sig, return_type, arg0_type)
77
- mod.send(:define_method, method_sig.method_name) do |arg0, &blk|
76
+ def self.create_validator_method_fast1(mod, original_method, method_sig, original_visibility, return_type, arg0_type)
77
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, &blk|
78
78
  # This method is a manually sped-up version of more general code in `validate_call`
79
79
  unless arg0.is_a?(arg0_type)
80
80
  CallValidation.report_error(
@@ -122,8 +122,8 @@ module T::Private::Methods::CallValidation
122
122
  end
123
123
  end
124
124
 
125
- def self.create_validator_method_fast2(mod, original_method, method_sig, return_type, arg0_type, arg1_type)
126
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, &blk|
125
+ def self.create_validator_method_fast2(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type)
126
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, &blk|
127
127
  # This method is a manually sped-up version of more general code in `validate_call`
128
128
  unless arg0.is_a?(arg0_type)
129
129
  CallValidation.report_error(
@@ -183,8 +183,8 @@ module T::Private::Methods::CallValidation
183
183
  end
184
184
  end
185
185
 
186
- def self.create_validator_method_fast3(mod, original_method, method_sig, return_type, arg0_type, arg1_type, arg2_type)
187
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, &blk|
186
+ def self.create_validator_method_fast3(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type, arg2_type)
187
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, &blk|
188
188
  # This method is a manually sped-up version of more general code in `validate_call`
189
189
  unless arg0.is_a?(arg0_type)
190
190
  CallValidation.report_error(
@@ -256,8 +256,8 @@ module T::Private::Methods::CallValidation
256
256
  end
257
257
  end
258
258
 
259
- def self.create_validator_method_fast4(mod, original_method, method_sig, return_type, arg0_type, arg1_type, arg2_type, arg3_type)
260
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, arg3, &blk|
259
+ def self.create_validator_method_fast4(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type, arg2_type, arg3_type)
260
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, arg3, &blk|
261
261
  # This method is a manually sped-up version of more general code in `validate_call`
262
262
  unless arg0.is_a?(arg0_type)
263
263
  CallValidation.report_error(
@@ -341,24 +341,24 @@ module T::Private::Methods::CallValidation
341
341
  end
342
342
  end
343
343
 
344
- def self.create_validator_procedure_fast(mod, original_method, method_sig)
344
+ def self.create_validator_procedure_fast(mod, original_method, method_sig, original_visibility)
345
345
  # trampoline to reduce stack frame size
346
346
  if method_sig.arg_types.empty?
347
- create_validator_procedure_fast0(mod, original_method, method_sig)
347
+ create_validator_procedure_fast0(mod, original_method, method_sig, original_visibility)
348
348
  elsif method_sig.arg_types.length == 1
349
- create_validator_procedure_fast1(mod, original_method, method_sig,
349
+ create_validator_procedure_fast1(mod, original_method, method_sig, original_visibility,
350
350
  method_sig.arg_types[0][1].raw_type)
351
351
  elsif method_sig.arg_types.length == 2
352
- create_validator_procedure_fast2(mod, original_method, method_sig,
352
+ create_validator_procedure_fast2(mod, original_method, method_sig, original_visibility,
353
353
  method_sig.arg_types[0][1].raw_type,
354
354
  method_sig.arg_types[1][1].raw_type)
355
355
  elsif method_sig.arg_types.length == 3
356
- create_validator_procedure_fast3(mod, original_method, method_sig,
356
+ create_validator_procedure_fast3(mod, original_method, method_sig, original_visibility,
357
357
  method_sig.arg_types[0][1].raw_type,
358
358
  method_sig.arg_types[1][1].raw_type,
359
359
  method_sig.arg_types[2][1].raw_type)
360
360
  elsif method_sig.arg_types.length == 4
361
- create_validator_procedure_fast4(mod, original_method, method_sig,
361
+ create_validator_procedure_fast4(mod, original_method, method_sig, original_visibility,
362
362
  method_sig.arg_types[0][1].raw_type,
363
363
  method_sig.arg_types[1][1].raw_type,
364
364
  method_sig.arg_types[2][1].raw_type,
@@ -368,8 +368,8 @@ module T::Private::Methods::CallValidation
368
368
  end
369
369
  end
370
370
 
371
- def self.create_validator_procedure_fast0(mod, original_method, method_sig)
372
- mod.send(:define_method, method_sig.method_name) do |&blk|
371
+ def self.create_validator_procedure_fast0(mod, original_method, method_sig, original_visibility)
372
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |&blk|
373
373
  # This method is a manually sped-up version of more general code in `validate_call`
374
374
  # The following line breaks are intentional to show nice pry message
375
375
 
@@ -391,8 +391,8 @@ module T::Private::Methods::CallValidation
391
391
  end
392
392
  end
393
393
 
394
- def self.create_validator_procedure_fast1(mod, original_method, method_sig, arg0_type)
395
- mod.send(:define_method, method_sig.method_name) do |arg0, &blk|
394
+ def self.create_validator_procedure_fast1(mod, original_method, method_sig, original_visibility, arg0_type)
395
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, &blk|
396
396
  # This method is a manually sped-up version of more general code in `validate_call`
397
397
  unless arg0.is_a?(arg0_type)
398
398
  CallValidation.report_error(
@@ -426,8 +426,8 @@ module T::Private::Methods::CallValidation
426
426
  end
427
427
  end
428
428
 
429
- def self.create_validator_procedure_fast2(mod, original_method, method_sig, arg0_type, arg1_type)
430
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, &blk|
429
+ def self.create_validator_procedure_fast2(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type)
430
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, &blk|
431
431
  # This method is a manually sped-up version of more general code in `validate_call`
432
432
  unless arg0.is_a?(arg0_type)
433
433
  CallValidation.report_error(
@@ -473,8 +473,8 @@ module T::Private::Methods::CallValidation
473
473
  end
474
474
  end
475
475
 
476
- def self.create_validator_procedure_fast3(mod, original_method, method_sig, arg0_type, arg1_type, arg2_type)
477
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, &blk|
476
+ def self.create_validator_procedure_fast3(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type, arg2_type)
477
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, &blk|
478
478
  # This method is a manually sped-up version of more general code in `validate_call`
479
479
  unless arg0.is_a?(arg0_type)
480
480
  CallValidation.report_error(
@@ -532,8 +532,8 @@ module T::Private::Methods::CallValidation
532
532
  end
533
533
  end
534
534
 
535
- def self.create_validator_procedure_fast4(mod, original_method, method_sig, arg0_type, arg1_type, arg2_type, arg3_type)
536
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, arg3, &blk|
535
+ def self.create_validator_procedure_fast4(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type, arg2_type, arg3_type)
536
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, arg3, &blk|
537
537
  # This method is a manually sped-up version of more general code in `validate_call`
538
538
  unless arg0.is_a?(arg0_type)
539
539
  CallValidation.report_error(
@@ -603,27 +603,27 @@ module T::Private::Methods::CallValidation
603
603
  end
604
604
  end
605
605
 
606
- def self.create_validator_method_medium(mod, original_method, method_sig)
606
+ def self.create_validator_method_medium(mod, original_method, method_sig, original_visibility)
607
607
  if method_sig.return_type.is_a?(T::Private::Types::Void)
608
608
  raise 'Should have used create_validator_procedure_medium'
609
609
  end
610
610
  # trampoline to reduce stack frame size
611
611
  if method_sig.arg_types.empty?
612
- create_validator_method_medium0(mod, original_method, method_sig, method_sig.return_type)
612
+ create_validator_method_medium0(mod, original_method, method_sig, original_visibility, method_sig.return_type)
613
613
  elsif method_sig.arg_types.length == 1
614
- create_validator_method_medium1(mod, original_method, method_sig, method_sig.return_type,
614
+ create_validator_method_medium1(mod, original_method, method_sig, original_visibility, method_sig.return_type,
615
615
  method_sig.arg_types[0][1])
616
616
  elsif method_sig.arg_types.length == 2
617
- create_validator_method_medium2(mod, original_method, method_sig, method_sig.return_type,
617
+ create_validator_method_medium2(mod, original_method, method_sig, original_visibility, method_sig.return_type,
618
618
  method_sig.arg_types[0][1],
619
619
  method_sig.arg_types[1][1])
620
620
  elsif method_sig.arg_types.length == 3
621
- create_validator_method_medium3(mod, original_method, method_sig, method_sig.return_type,
621
+ create_validator_method_medium3(mod, original_method, method_sig, original_visibility, method_sig.return_type,
622
622
  method_sig.arg_types[0][1],
623
623
  method_sig.arg_types[1][1],
624
624
  method_sig.arg_types[2][1])
625
625
  elsif method_sig.arg_types.length == 4
626
- create_validator_method_medium4(mod, original_method, method_sig, method_sig.return_type,
626
+ create_validator_method_medium4(mod, original_method, method_sig, original_visibility, method_sig.return_type,
627
627
  method_sig.arg_types[0][1],
628
628
  method_sig.arg_types[1][1],
629
629
  method_sig.arg_types[2][1],
@@ -633,8 +633,8 @@ module T::Private::Methods::CallValidation
633
633
  end
634
634
  end
635
635
 
636
- def self.create_validator_method_medium0(mod, original_method, method_sig, return_type)
637
- mod.send(:define_method, method_sig.method_name) do |&blk|
636
+ def self.create_validator_method_medium0(mod, original_method, method_sig, original_visibility, return_type)
637
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |&blk|
638
638
  # This method is a manually sped-up version of more general code in `validate_call`
639
639
  # The following line breaks are intentional to show nice pry message
640
640
 
@@ -670,8 +670,8 @@ module T::Private::Methods::CallValidation
670
670
  end
671
671
  end
672
672
 
673
- def self.create_validator_method_medium1(mod, original_method, method_sig, return_type, arg0_type)
674
- mod.send(:define_method, method_sig.method_name) do |arg0, &blk|
673
+ def self.create_validator_method_medium1(mod, original_method, method_sig, original_visibility, return_type, arg0_type)
674
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, &blk|
675
675
  # This method is a manually sped-up version of more general code in `validate_call`
676
676
  unless arg0_type.valid?(arg0)
677
677
  CallValidation.report_error(
@@ -719,8 +719,8 @@ module T::Private::Methods::CallValidation
719
719
  end
720
720
  end
721
721
 
722
- def self.create_validator_method_medium2(mod, original_method, method_sig, return_type, arg0_type, arg1_type)
723
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, &blk|
722
+ def self.create_validator_method_medium2(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type)
723
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, &blk|
724
724
  # This method is a manually sped-up version of more general code in `validate_call`
725
725
  unless arg0_type.valid?(arg0)
726
726
  CallValidation.report_error(
@@ -780,8 +780,8 @@ module T::Private::Methods::CallValidation
780
780
  end
781
781
  end
782
782
 
783
- def self.create_validator_method_medium3(mod, original_method, method_sig, return_type, arg0_type, arg1_type, arg2_type)
784
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, &blk|
783
+ def self.create_validator_method_medium3(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type, arg2_type)
784
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, &blk|
785
785
  # This method is a manually sped-up version of more general code in `validate_call`
786
786
  unless arg0_type.valid?(arg0)
787
787
  CallValidation.report_error(
@@ -853,8 +853,8 @@ module T::Private::Methods::CallValidation
853
853
  end
854
854
  end
855
855
 
856
- def self.create_validator_method_medium4(mod, original_method, method_sig, return_type, arg0_type, arg1_type, arg2_type, arg3_type)
857
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, arg3, &blk|
856
+ def self.create_validator_method_medium4(mod, original_method, method_sig, original_visibility, return_type, arg0_type, arg1_type, arg2_type, arg3_type)
857
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, arg3, &blk|
858
858
  # This method is a manually sped-up version of more general code in `validate_call`
859
859
  unless arg0_type.valid?(arg0)
860
860
  CallValidation.report_error(
@@ -938,24 +938,24 @@ module T::Private::Methods::CallValidation
938
938
  end
939
939
  end
940
940
 
941
- def self.create_validator_procedure_medium(mod, original_method, method_sig)
941
+ def self.create_validator_procedure_medium(mod, original_method, method_sig, original_visibility)
942
942
  # trampoline to reduce stack frame size
943
943
  if method_sig.arg_types.empty?
944
- create_validator_procedure_medium0(mod, original_method, method_sig)
944
+ create_validator_procedure_medium0(mod, original_method, method_sig, original_visibility)
945
945
  elsif method_sig.arg_types.length == 1
946
- create_validator_procedure_medium1(mod, original_method, method_sig,
946
+ create_validator_procedure_medium1(mod, original_method, method_sig, original_visibility,
947
947
  method_sig.arg_types[0][1])
948
948
  elsif method_sig.arg_types.length == 2
949
- create_validator_procedure_medium2(mod, original_method, method_sig,
949
+ create_validator_procedure_medium2(mod, original_method, method_sig, original_visibility,
950
950
  method_sig.arg_types[0][1],
951
951
  method_sig.arg_types[1][1])
952
952
  elsif method_sig.arg_types.length == 3
953
- create_validator_procedure_medium3(mod, original_method, method_sig,
953
+ create_validator_procedure_medium3(mod, original_method, method_sig, original_visibility,
954
954
  method_sig.arg_types[0][1],
955
955
  method_sig.arg_types[1][1],
956
956
  method_sig.arg_types[2][1])
957
957
  elsif method_sig.arg_types.length == 4
958
- create_validator_procedure_medium4(mod, original_method, method_sig,
958
+ create_validator_procedure_medium4(mod, original_method, method_sig, original_visibility,
959
959
  method_sig.arg_types[0][1],
960
960
  method_sig.arg_types[1][1],
961
961
  method_sig.arg_types[2][1],
@@ -965,8 +965,8 @@ module T::Private::Methods::CallValidation
965
965
  end
966
966
  end
967
967
 
968
- def self.create_validator_procedure_medium0(mod, original_method, method_sig)
969
- mod.send(:define_method, method_sig.method_name) do |&blk|
968
+ def self.create_validator_procedure_medium0(mod, original_method, method_sig, original_visibility)
969
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |&blk|
970
970
  # This method is a manually sped-up version of more general code in `validate_call`
971
971
  # The following line breaks are intentional to show nice pry message
972
972
 
@@ -988,8 +988,8 @@ module T::Private::Methods::CallValidation
988
988
  end
989
989
  end
990
990
 
991
- def self.create_validator_procedure_medium1(mod, original_method, method_sig, arg0_type)
992
- mod.send(:define_method, method_sig.method_name) do |arg0, &blk|
991
+ def self.create_validator_procedure_medium1(mod, original_method, method_sig, original_visibility, arg0_type)
992
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, &blk|
993
993
  # This method is a manually sped-up version of more general code in `validate_call`
994
994
  unless arg0_type.valid?(arg0)
995
995
  CallValidation.report_error(
@@ -1023,8 +1023,8 @@ module T::Private::Methods::CallValidation
1023
1023
  end
1024
1024
  end
1025
1025
 
1026
- def self.create_validator_procedure_medium2(mod, original_method, method_sig, arg0_type, arg1_type)
1027
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, &blk|
1026
+ def self.create_validator_procedure_medium2(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type)
1027
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, &blk|
1028
1028
  # This method is a manually sped-up version of more general code in `validate_call`
1029
1029
  unless arg0_type.valid?(arg0)
1030
1030
  CallValidation.report_error(
@@ -1070,8 +1070,8 @@ module T::Private::Methods::CallValidation
1070
1070
  end
1071
1071
  end
1072
1072
 
1073
- def self.create_validator_procedure_medium3(mod, original_method, method_sig, arg0_type, arg1_type, arg2_type)
1074
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, &blk|
1073
+ def self.create_validator_procedure_medium3(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type, arg2_type)
1074
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, &blk|
1075
1075
  # This method is a manually sped-up version of more general code in `validate_call`
1076
1076
  unless arg0_type.valid?(arg0)
1077
1077
  CallValidation.report_error(
@@ -1129,8 +1129,8 @@ module T::Private::Methods::CallValidation
1129
1129
  end
1130
1130
  end
1131
1131
 
1132
- def self.create_validator_procedure_medium4(mod, original_method, method_sig, arg0_type, arg1_type, arg2_type, arg3_type)
1133
- mod.send(:define_method, method_sig.method_name) do |arg0, arg1, arg2, arg3, &blk|
1132
+ def self.create_validator_procedure_medium4(mod, original_method, method_sig, original_visibility, arg0_type, arg1_type, arg2_type, arg3_type)
1133
+ T::Private::ClassUtils.def_with_visibility(mod, method_sig.method_name, original_visibility) do |arg0, arg1, arg2, arg3, &blk|
1134
1134
  # This method is a manually sped-up version of more general code in `validate_call`
1135
1135
  unless arg0_type.valid?(arg0)
1136
1136
  CallValidation.report_error(
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.10285
4
+ version: 0.5.10313
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-06 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest