sorbet-runtime 0.5.11361 → 0.5.11366
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 -3
- data/lib/types/configuration.rb +1 -1
- data/lib/types/private/methods/decl_builder.rb +3 -3
- data/lib/types/private/methods/signature_validation.rb +1 -1
- data/lib/types/private/runtime_levels.rb +0 -3
- metadata +2 -3
- data/lib/types/private/compiler.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: 1d874e56653a8c57e9270c9930a4dff5aa0acc61946d03c7375b31cc63111d7a
|
|
4
|
+
data.tar.gz: c5055439fa4a97a49dfc9b087569210976d5367a9fbd666157929789ac781944
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cb451f625728a28cb2c0936c4c1bced1a45013475fb77999c3f73a44f91f41625da8b821088b0dd586e1d004802fc67bd76598c185add750d269dcf65a8a4b91
|
|
7
|
+
data.tar.gz: 5658793420bb954acebaaf058737c14ea83f6c096afdce547f2d474f458aa29094b4ffa3c4769a5ee07e467a1ee64849bcb98e4ea57728f21c0bb5007a3c1fc1
|
data/lib/sorbet-runtime.rb
CHANGED
data/lib/types/configuration.rb
CHANGED
|
@@ -113,7 +113,7 @@ module T::Configuration
|
|
|
113
113
|
# statically, so that methods don't have to guard themselves from being
|
|
114
114
|
# called incorrectly by untyped code.
|
|
115
115
|
#
|
|
116
|
-
# @param [:never, :
|
|
116
|
+
# @param [:never, :tests, :always] default_checked_level
|
|
117
117
|
def self.default_checked_level=(default_checked_level)
|
|
118
118
|
T::Private::RuntimeLevels.default_checked_level = default_checked_level
|
|
119
119
|
end
|
|
@@ -101,7 +101,7 @@ module T::Private::Methods
|
|
|
101
101
|
if !decl.checked.equal?(ARG_NOT_PROVIDED)
|
|
102
102
|
raise BuilderError.new("You can't call .checked multiple times in a signature.")
|
|
103
103
|
end
|
|
104
|
-
if
|
|
104
|
+
if level == :never && !decl.on_failure.equal?(ARG_NOT_PROVIDED)
|
|
105
105
|
raise BuilderError.new("You can't use .checked(:#{level}) with .on_failure because .on_failure will have no effect.")
|
|
106
106
|
end
|
|
107
107
|
if !T::Private::RuntimeLevels::LEVELS.include?(level)
|
|
@@ -119,7 +119,7 @@ module T::Private::Methods
|
|
|
119
119
|
if !decl.on_failure.equal?(ARG_NOT_PROVIDED)
|
|
120
120
|
raise BuilderError.new("You can't call .on_failure multiple times in a signature.")
|
|
121
121
|
end
|
|
122
|
-
if decl.checked == :never
|
|
122
|
+
if decl.checked == :never
|
|
123
123
|
raise BuilderError.new("You can't use .on_failure with .checked(:#{decl.checked}) because .on_failure will have no effect.")
|
|
124
124
|
end
|
|
125
125
|
|
|
@@ -222,7 +222,7 @@ module T::Private::Methods
|
|
|
222
222
|
end
|
|
223
223
|
if decl.checked.equal?(ARG_NOT_PROVIDED)
|
|
224
224
|
default_checked_level = T::Private::RuntimeLevels.default_checked_level
|
|
225
|
-
if
|
|
225
|
+
if default_checked_level == :never && !decl.on_failure.equal?(ARG_NOT_PROVIDED)
|
|
226
226
|
raise BuilderError.new("To use .on_failure you must additionally call .checked(:tests) or .checked(:always), otherwise, the .on_failure has no effect.")
|
|
227
227
|
end
|
|
228
228
|
decl.checked = default_checked_level
|
|
@@ -234,7 +234,7 @@ module T::Private::Methods::SignatureValidation
|
|
|
234
234
|
return if signature.override_allow_incompatible
|
|
235
235
|
return if super_signature.mode == Modes.untyped
|
|
236
236
|
return unless [signature, super_signature].all? do |sig|
|
|
237
|
-
sig.check_level == :always ||
|
|
237
|
+
sig.check_level == :always || (sig.check_level == :tests && T::Private::RuntimeLevels.check_tests?)
|
|
238
238
|
end
|
|
239
239
|
mode_noun = super_signature.mode == Modes.abstract ? 'implementation' : 'override'
|
|
240
240
|
|
|
@@ -12,9 +12,6 @@ module T::Private::RuntimeLevels
|
|
|
12
12
|
# Don't even validate in tests, b/c too expensive,
|
|
13
13
|
# or b/c we fully trust the static typing
|
|
14
14
|
:never,
|
|
15
|
-
# Validate the sig when the file is using the Sorbet Compiler.
|
|
16
|
-
# Behaves like :never when interpreted.
|
|
17
|
-
:compiled,
|
|
18
15
|
].freeze
|
|
19
16
|
|
|
20
17
|
@check_tests = false
|
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.11366
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stripe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-05-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|
|
@@ -159,7 +159,6 @@ files:
|
|
|
159
159
|
- lib/types/private/caller_utils.rb
|
|
160
160
|
- lib/types/private/casts.rb
|
|
161
161
|
- lib/types/private/class_utils.rb
|
|
162
|
-
- lib/types/private/compiler.rb
|
|
163
162
|
- lib/types/private/decl_state.rb
|
|
164
163
|
- lib/types/private/final.rb
|
|
165
164
|
- lib/types/private/methods/_methods.rb
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
# typed: true
|
|
3
|
-
|
|
4
|
-
module T::Private
|
|
5
|
-
module Compiler
|
|
6
|
-
# If this code ever runs, the caller is running interpreted (or the
|
|
7
|
-
# compiler didn't see the call to `running_compiled?` statically.)
|
|
8
|
-
#
|
|
9
|
-
# The Sorbet Compiler replaces calls to this method unconditionally (no
|
|
10
|
-
# runtime guards) to return `true` when compiling a file.
|
|
11
|
-
def self.running_compiled?
|
|
12
|
-
false
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# Returns `nil` because the compiler isn't running.
|
|
16
|
-
#
|
|
17
|
-
# The Sorbet Compiler replaces calls to this method unconditionally (no
|
|
18
|
-
# runtime guards) to return a String showing the Sorbet Compiler's version
|
|
19
|
-
# string.
|
|
20
|
-
def self.compiler_version
|
|
21
|
-
nil
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|