sorbet-runtime 0.5.5967 → 0.5.6001
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 +4 -4
- data/lib/sorbet-runtime.rb +0 -1
- data/lib/types/non_forcing_constants.rb +20 -16
- data/lib/types/private/methods/signature.rb +4 -0
- metadata +2 -3
- data/lib/types/runtime_profiled.rb +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb189356e7591bc832e548a2e936886386e44994d58895be781cacb7e2bfb6df
|
4
|
+
data.tar.gz: faea01b2f20a167641fde6f2af6fd30d5af938627b6be3c04ae2ce839b8044a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87f081be786e0abe490d2fdbfda43323974396452a649869527a19130bc5ecc6c7226e88d05e6e511bd0dd88e86faed26e8f4919ab58809ae4e348d34d41d652
|
7
|
+
data.tar.gz: 8a832171b62f05453e9e30ca9d720ac76da6141152f66b04f54c7b82e8964be97d10e7e8f6c40b5de4c979eb2729b2fd1cfbdf64ce281ce55e5a413291a16164
|
data/lib/sorbet-runtime.rb
CHANGED
@@ -22,7 +22,6 @@ require_relative 'types/configuration'
|
|
22
22
|
require_relative 'types/profile'
|
23
23
|
require_relative 'types/_types'
|
24
24
|
require_relative 'types/private/decl_state'
|
25
|
-
require_relative 'types/runtime_profiled'
|
26
25
|
require_relative 'types/private/class_utils'
|
27
26
|
require_relative 'types/private/runtime_levels'
|
28
27
|
require_relative 'types/private/methods/_methods'
|
@@ -30,25 +30,29 @@ module T::NonForcingConstants
|
|
30
30
|
|
31
31
|
current_klass = Object
|
32
32
|
current_prefix = ''
|
33
|
-
else
|
34
|
-
if current_klass.autoload?(part)
|
35
|
-
# There's an autoload registered for that constant, which means it's not
|
36
|
-
# yet loaded. `value` can't be an instance of something not yet loaded.
|
37
|
-
return false
|
38
|
-
end
|
39
33
|
|
40
|
-
#
|
41
|
-
|
42
|
-
if
|
43
|
-
|
44
|
-
|
34
|
+
# if this had a :: prefix, then there's no more loading to
|
35
|
+
# do---skip to the next one
|
36
|
+
next if part == ""
|
37
|
+
end
|
38
|
+
|
39
|
+
if current_klass.autoload?(part)
|
40
|
+
# There's an autoload registered for that constant, which means it's not
|
41
|
+
# yet loaded. `value` can't be an instance of something not yet loaded.
|
42
|
+
return false
|
43
|
+
end
|
44
|
+
|
45
|
+
# Sorbet guarantees that the string is an absolutely resolved name.
|
46
|
+
search_inheritance_chain = false
|
47
|
+
if !current_klass.const_defined?(part, search_inheritance_chain)
|
48
|
+
return false
|
49
|
+
end
|
45
50
|
|
46
|
-
|
47
|
-
|
51
|
+
current_klass = current_klass.const_get(part)
|
52
|
+
current_prefix = "#{current_prefix}::#{part}"
|
48
53
|
|
49
|
-
|
50
|
-
|
51
|
-
end
|
54
|
+
if !Module.===(current_klass)
|
55
|
+
raise ArgumentError.new("#{current_prefix} is not a class or module")
|
52
56
|
end
|
53
57
|
end
|
54
58
|
|
@@ -67,6 +67,10 @@ class T::Private::Methods::Signature
|
|
67
67
|
if !extra_names.empty?
|
68
68
|
raise "The declaration for `#{method.name}` has extra parameter(s): #{extra_names.join(', ')}"
|
69
69
|
end
|
70
|
+
|
71
|
+
if parameters.size != raw_arg_types.size
|
72
|
+
raise "The declaration for `#{method.name}` has arguments with duplicate names"
|
73
|
+
end
|
70
74
|
|
71
75
|
parameters.zip(raw_arg_types) do |(param_kind, param_name), (type_name, raw_type)|
|
72
76
|
if type_name != param_name
|
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.
|
4
|
+
version: 0.5.6001
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -210,7 +210,6 @@ files:
|
|
210
210
|
- lib/types/props/type_validation.rb
|
211
211
|
- lib/types/props/utils.rb
|
212
212
|
- lib/types/props/weak_constructor.rb
|
213
|
-
- lib/types/runtime_profiled.rb
|
214
213
|
- lib/types/sig.rb
|
215
214
|
- lib/types/struct.rb
|
216
215
|
- lib/types/types/attached_class.rb
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# typed: strict
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
#
|
5
|
-
# From the static system, T::Utils::RuntimeProfiled is T.untyped.
|
6
|
-
#
|
7
|
-
# But from the runtime system, it's a random class (specifically, a class that
|
8
|
-
# normal programs currently don't have any instances of).
|
9
|
-
#
|
10
|
-
# Thus, T::Utils::RuntimeProfiled can be used to introduce runtime-only type
|
11
|
-
# errors. This seems like a bad idea, but it's not. It can be used to gather
|
12
|
-
# runtime type information from running code via a custom T::Configuration
|
13
|
-
# handler.
|
14
|
-
#
|
15
|
-
# This process has only ever been used at Stripe, and is likely to have rough
|
16
|
-
# edges. If you've managed to find your way here and you're curious to try it,
|
17
|
-
# please chat with us on Slack. There are no docs.
|
18
|
-
#
|
19
|
-
# See also: the --suggest-runtime-profiled flag to sorbet.
|
20
|
-
#
|
21
|
-
|
22
|
-
module T; end
|
23
|
-
module T::Utils; end
|
24
|
-
class T::Utils::RuntimeProfiled; end
|