File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -91,11 +91,14 @@ def coerce(value, state:)
91
91
#
92
92
# @return [Object]
93
93
def to_sorbet_type
94
- case values
94
+ types = values . map { OnebusawaySDK ::Internal ::Util ::SorbetRuntimeSupport . to_sorbet_type ( _1 ) } . uniq
95
+ case types
95
96
in [ ]
96
97
T . noreturn
97
- in [ value , *_ ]
98
- T . all ( OnebusawaySDK ::Internal ::Util ::SorbetRuntimeSupport . to_sorbet_type ( value ) , self )
98
+ in [ type ]
99
+ type
100
+ else
101
+ T . any ( *types )
99
102
end
100
103
end
101
104
Original file line number Diff line number Diff line change @@ -201,11 +201,14 @@ def dump(value, state:)
201
201
#
202
202
# @return [Object]
203
203
def to_sorbet_type
204
- case ( v = variants )
204
+ types = variants . map { OnebusawaySDK ::Internal ::Util ::SorbetRuntimeSupport . to_sorbet_type ( _1 ) } . uniq
205
+ case types
205
206
in [ ]
206
207
T . noreturn
208
+ in [ type ]
209
+ type
207
210
else
208
- T . any ( *v . map { OnebusawaySDK :: Internal :: Util :: SorbetRuntimeSupport . to_sorbet_type ( _1 ) } )
211
+ T . any ( *types )
209
212
end
210
213
end
211
214
Original file line number Diff line number Diff line change @@ -14,16 +14,16 @@ module OnebusawaySDK
14
14
mod . constants . each do |name |
15
15
case mod . const_get ( name )
16
16
in true | false
17
- mod . define_sorbet_constant! ( :TaggedBoolean ) { T . type_alias { T . all ( T ::Boolean , mod ) } }
17
+ mod . define_sorbet_constant! ( :TaggedBoolean ) { T . type_alias { T ::Boolean } }
18
18
mod . define_sorbet_constant! ( :OrBoolean ) { T . type_alias { T ::Boolean } }
19
19
in Integer
20
- mod . define_sorbet_constant! ( :TaggedInteger ) { T . type_alias { T . all ( Integer , mod ) } }
20
+ mod . define_sorbet_constant! ( :TaggedInteger ) { T . type_alias { Integer } }
21
21
mod . define_sorbet_constant! ( :OrInteger ) { T . type_alias { Integer } }
22
22
in Float
23
- mod . define_sorbet_constant! ( :TaggedFloat ) { T . type_alias { T . all ( Float , mod ) } }
23
+ mod . define_sorbet_constant! ( :TaggedFloat ) { T . type_alias { Float } }
24
24
mod . define_sorbet_constant! ( :OrFloat ) { T . type_alias { Float } }
25
25
in Symbol
26
- mod . define_sorbet_constant! ( :TaggedSymbol ) { T . type_alias { T . all ( Symbol , mod ) } }
26
+ mod . define_sorbet_constant! ( :TaggedSymbol ) { T . type_alias { Symbol } }
27
27
mod . define_sorbet_constant! ( :OrSymbol ) { T . type_alias { T . any ( Symbol , String ) } }
28
28
else
29
29
end
You can’t perform that action at this time.
0 commit comments