sorbet-runtime 0.5.5981 → 0.5.5991
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/types/non_forcing_constants.rb +20 -16
- data/lib/types/private/methods/signature.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b400aa184ecef7448624aa502683ba8932c1a3a9712dc5afba81826eb511e8ce
|
|
4
|
+
data.tar.gz: f0638d866cf2bcf2b47f205dbb9a231c8380a1b6f05d9170677a71d664ebbe91
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c02033ce23748e5e44d33376349762115a5c405e66e19c4aff8b81ca8332c583d9bddce7b68c9cbb873d20d110de1f8d649f5237dd6c0cba4bf16b3c6643b96
|
|
7
|
+
data.tar.gz: fc0677383d474366916930e7d80fcc305eda941dcf019017a17e071c00cb4520597c5140ec97a282ab813a55395027e120f4e31cfe8f273423396676a4e73135
|
|
@@ -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.5991
|
|
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-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|