Closed postmodern closed 1 year ago
I get a similar error when attempting to generate RBS output, but it gets a little further:
[OMIT ] (Ronin::Support::Binary::CTypes::Mixin#initialize_type_system) no YARD return type given, using untyped
[OMIT ] (Ronin::Support::Binary::CTypes::Mixin#initialize_type_system) no YARD return type given, using untyped
[ERROR] no implicit conversion of Parlour::Types::Raw into Integer
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/type_converter.rb:179:in `initialize'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/type_converter.rb:179:in `new'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/type_converter.rb:179:in `yard_to_parlour'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/type_converter.rb:116:in `block in yard_to_parlour'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/type_converter.rb:116:in `map'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/type_converter.rb:116:in `yard_to_parlour'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:364:in `block in add_methods'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:254:in `each'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:254:in `add_methods'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:553:in `add_namespace'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:558:in `block in add_namespace'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:558:in `each'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:558:in `add_namespace'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:558:in `block in add_namespace'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:558:in `each'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:558:in `add_namespace'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:558:in `block in add_namespace'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:558:in `each'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:558:in `add_namespace'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:570:in `block in populate'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:570:in `each'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:570:in `populate'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/generator.rb:590:in `run'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/lib/sord/parlour_plugin.rb:70:in `generate'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/sord-4.0.0/exe/sord:88:in `block (2 levels) in <top (required)>'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/command.rb:187:in `call'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/command.rb:157:in `run'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/runner.rb:61:in `run!'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!'
/data/home/postmodern/code/ronin-rb/vendor/bundle/ruby/3.1.0/gems/commander-4.6.0/lib/commander/import.rb:7:in `block in <top (required)>'
Parlour warning: RBS generation: 'type' is a keyword in RBS, renaming method parameter to '_type'
Parlour warning: RBS generation: 'type' is a keyword in RBS, renaming method parameter to '_type'
Parlour warning: RBS generation: 'type' is a keyword in RBS, renaming method parameter to '_type'
Parlour warning: RBS generation: 'type' is a keyword in RBS, renaming method parameter to '_type'
Thanks - #152 should fix this!
The cause of this bug was something new I didn't know about Ruby - const_get
isn't always relative:
module Parlour
module Types
class Array
end
end
end
Parlour::Types.const_get("Array") # => Parlour::Types::Array, that's right
Parlour::Types.const_get("::Array") # => Ruby's stdlib Array class!
Describe the bug I was testing out
sord-4.0.0
on one of my YARDoced projects (in the 1.0.0 branch) under ruby-3.1.2, but ran into this exception when attempting to generate RBI output.To Reproduce
gem 'sord'
to theGemfile
.bundle install
.bundle exec sord defs.rbi
Expected behavior Completes successfully.
Actual behavior
Additional information
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]