sorbet-runtime 0.4.4361 → 0.4.4362
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/types/private/methods/decl_builder.rb +9 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83a3d65a2902eb4d43f12d037a3ace849d3a2ff1
|
4
|
+
data.tar.gz: b873428cd637d7f053992d3b9c6f1611dfcd9885
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aed781e38d9773f591c0459f402142b3dfa916594dc1fcda93edfac13b973e3292b6a9ed1e349c735c2ea7d381fb1afc0621085418ed1e28418e8a46bcdcaa51
|
7
|
+
data.tar.gz: 8290154bb333c23ebc8f621907c94f21a685d642f3a3db00d07d83454038df0022416330f2158344e66705c8cca301260402aa122738bad86740e0ca492344f6
|
@@ -85,8 +85,8 @@ module T::Private::Methods
|
|
85
85
|
if !decl.checked.equal?(ARG_NOT_PROVIDED)
|
86
86
|
raise BuilderError.new("You can't call .checked multiple times in a signature.")
|
87
87
|
end
|
88
|
-
if !decl.soft_notify.equal?(ARG_NOT_PROVIDED)
|
89
|
-
raise BuilderError.new("You can't use .checked with .on_failure.")
|
88
|
+
if level == :never && !decl.soft_notify.equal?(ARG_NOT_PROVIDED)
|
89
|
+
raise BuilderError.new("You can't use .checked(:never) with .on_failure because .on_failure will have no effect.")
|
90
90
|
end
|
91
91
|
if !decl.generated.equal?(ARG_NOT_PROVIDED)
|
92
92
|
raise BuilderError.new("You can't use .checked with .generated.")
|
@@ -106,8 +106,8 @@ module T::Private::Methods
|
|
106
106
|
if !decl.soft_notify.equal?(ARG_NOT_PROVIDED)
|
107
107
|
raise BuilderError.new("You can't call .on_failure multiple times in a signature.")
|
108
108
|
end
|
109
|
-
if
|
110
|
-
raise BuilderError.new("You can't use .on_failure with .checked.")
|
109
|
+
if decl.checked == :never
|
110
|
+
raise BuilderError.new("You can't use .on_failure with .checked(:never) because .on_failure will have no effect.")
|
111
111
|
end
|
112
112
|
if !decl.generated.equal?(ARG_NOT_PROVIDED)
|
113
113
|
raise BuilderError.new("You can't use .on_failure with .generated.")
|
@@ -243,7 +243,11 @@ module T::Private::Methods
|
|
243
243
|
decl.bind = nil
|
244
244
|
end
|
245
245
|
if decl.checked.equal?(ARG_NOT_PROVIDED)
|
246
|
-
|
246
|
+
default_checked_level = T::Private::RuntimeLevels.default_checked_level
|
247
|
+
if default_checked_level == :never && !decl.soft_notify.equal?(ARG_NOT_PROVIDED)
|
248
|
+
raise BuilderError.new("To use .on_failure you must additionally call .checked(:tests) or .checked(:always), otherwise, the .on_failure has no effect.")
|
249
|
+
end
|
250
|
+
decl.checked = default_checked_level
|
247
251
|
end
|
248
252
|
if decl.soft_notify.equal?(ARG_NOT_PROVIDED)
|
249
253
|
decl.soft_notify = nil
|