I noticed that sort-4.0.0 can successfully recognize duck-type signatures such as #foo or #to_s, but thinks duck-type signatures such as #=== or #foo! are not types.
module Test
#
# @param [#foo] arg1
#
# @param [#===] arg2
#
# @param [#foo!] arg3
#
# @return [Object]
#
def self.test(arg1,arg2,arg3)
end
end
$ bundle install
$ bundle exec sord defs.rbi
Expected behavior
Recognizes #=== and #foo!.
Actual behavior
$ be sord defs.rbi
[INFER] Assuming from filename you wish to generate in RBI format
[INFO ] Running YARD...
[warn]: Could not load default RDoc formatter, ignoring any markup (install RDoc to get default formatting).
Files: 1
Modules: 1 ( 1 undocumented)
Classes: 0 ( 0 undocumented)
Constants: 0 ( 0 undocumented)
Attributes: 0 ( 0 undocumented)
Methods: 1 ( 0 undocumented)
50.00% documented
[DUCK ] (Test.test) #foo looks like a duck type, replacing with untyped
[WARN ] (Test.test) "#===" does not appear to be a type
[WARN ] (Test.test) "#foo!" does not appear to be a type
[DONE ] Processed 2 objects (1 namespaces and 1 methods)
[WARN ] There were 2 important warnings in the output file, listed below.
[WARN ] The types which caused them have been replaced with SORD_ERROR_ constants.
[WARN ] Please edit the file to fix these errors.
[WARN ] Alternatively, edit your YARD documentation so that your types are valid and re-run Sord.
(Test.test) "#===" does not appear to be a type
(Test.test) "#foo!" does not appear to be a type
153 should fix this - I've verified that it produces untyped rather than a SORD_ERROR for the constructors taking #[] on your Ronin::Support::Binary::CTypes::OS definitions, which I imagine is where you saw this!
Describe the bug
I noticed that
sort-4.0.0
can successfully recognize duck-type signatures such as#foo
or#to_s
, but thinks duck-type signatures such as#===
or#foo!
are not types.To Reproduce
Gemfile
:lib/test.rb
:Expected behavior
Recognizes
#===
and#foo!
.Actual behavior
Additional information
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]