sorbet-runtime 0.5.5981 → 0.5.6014

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: 6ef024ba1f18a831127692d0a593c97ab174b5565ea24d3ea71f92f039b7e4c5
4
- data.tar.gz: 3acb33f46d6f6bffee8a16066b1930d01be3f1c1da8290924a8d2042e6802726
3
+ metadata.gz: 749f6ad0f9a9b8013b9b4dcc49aebb31be8303a05bff4f2109963de4531851cf
4
+ data.tar.gz: 5c7e5b6ea149ee384f9f608d071840b4cf49ca8b79b4f9726218c00de4a12fab
5
5
  SHA512:
6
- metadata.gz: 2ac2dc5dcab95f11d5fcd7aca8bfc34d731fa017b638cedda2995521f1526085122b552d3f2bb3312496170898e3284215237b37d88a14c91e6b143a27a8d5b8
7
- data.tar.gz: 3ed25f0734e82849ae495c1b0511bb806ab6c7fe45e3ae186a6e4c25000f1448fb2bfaa5042e5eebbc2c706c5af031db158057b683fe6d2006827474f274ddcd
6
+ metadata.gz: d12fb91c1006f2b1569ed3c9004f4edbd05321cc3133c6b094fe6bf11e08aea59520af48e003b1614f7ae5fe0101d36794ae28bada8901de8a1280391cb6c019
7
+ data.tar.gz: b8d39410ab961ba4c39e07ed10d69ce95f4181491464e862a1c6a5c288023a220de8750688fa5707b7515f8adc0e2117cefff8cfe5e3d4115fc4e1508f7997c6
@@ -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
- # Sorbet guarantees that the string is an absolutely resolved name.
41
- search_inheritance_chain = false
42
- if !current_klass.const_defined?(part, search_inheritance_chain)
43
- return false
44
- end
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
- current_klass = current_klass.const_get(part)
47
- current_prefix = "#{current_prefix}::#{part}"
51
+ current_klass = current_klass.const_get(part)
52
+ current_prefix = "#{current_prefix}::#{part}"
48
53
 
49
- if !Module.===(current_klass)
50
- raise ArgumentError.new("#{current_prefix} is not a class or module")
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
 
@@ -31,7 +31,7 @@ module T::Private::Methods
31
31
  )
32
32
  end
33
33
 
34
- def params(params)
34
+ def params(**params)
35
35
  check_live!
36
36
  if !decl.params.equal?(ARG_NOT_PROVIDED)
37
37
  raise BuilderError.new("You can't call .params twice")
@@ -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.5981
4
+ version: 0.5.6014
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-21 00:00:00.000000000 Z
11
+ date: 2020-10-29 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