Open tomoasleep opened 1 year ago
For now, when sord sees the type Class<String, Integer>, sord crashes with the following error.
Class<String, Integer>
Failure/Error: Parlour::Types.const_get(relative_generic_type).new(*parameters) ArgumentError: wrong number of arguments (given 2, expected 1) # ~/.anyenv/envs/rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.10950/lib/types/private/methods/call_validation_2_7.rb:1000:in `block in create_validator_procedure_medium1' # ~/.anyenv/envs/rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.10950/lib/types/private/abstract/declare.rb:38:in `new' # ~/.anyenv/envs/rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.10950/lib/types/private/abstract/declare.rb:38:in `block in declare_abstract' # ./lib/sord/type_converter.rb:212:in `yard_to_parlour'
(The error means Parlour::Types::Class.new only accepts 1 parameter.)
With this PR, sord avoids the error and considers the type as union of class types.
For now, when sord sees the type
Class<String, Integer>
, sord crashes with the following error.(The error means Parlour::Types::Class.new only accepts 1 parameter.)
With this PR, sord avoids the error and considers the type as union of class types.