Skip to content

Add sig #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Oct 13, 2024
Merged

Add sig #7

merged 29 commits into from
Oct 13, 2024

Conversation

sue445
Copy link
Collaborator

@sue445 sue445 commented Oct 12, 2024

Close #1

@sue445 sue445 added the chore Chore updates (Not included in release note) label Oct 12, 2024
sue445 added 13 commits October 13, 2024 02:52
```
lib/ruby_header_parser/data.rb:11:33: [error] Cannot pass a value of type `(::String | nil)` as an argument of type `::string`
│   (::String | nil) <: ::string
│     (::String | nil) <: (::String | ::_ToStr)
│       nil <: (::String | ::_ToStr)
│         nil <: ::String
│
│ Diagnostic ID: Ruby::ArgumentTypeMismatch
│
└       yaml = File.read(File.join(__dir__, "data.yml"))
                                   ~~~~~~~
```
```
lib/ruby_header_parser/util.rb:20:50: [warning] Cannot pass a value of type `::Proc` as a block-pass-argument of type `^((::String | ::Array[::String])) -> U(1)`
│   ::Proc <: ^((::String | ::Array[::String])) -> U(1)
│
│ Diagnostic ID: Ruby::BlockTypeMismatch
│
└       signature.scan(/[^,]+\([^()]*\)|[^,]+/).map(&:strip)
                                                    ~~~~~~~

```
…system` of type `::RubyHeaderParser::Parser`

```
lib/ruby_header_parser/parser.rb:150:8: [error] Cannot find compatible overloading of method `system` of type `::RubyHeaderParser::Parser`
│ Method types:
│   def system: (::String, *::String, ?unsetenv_others: ::boolish, ?pgroup: (true | ::Integer), ?umask: ::Integer, ?in: ::Kernel::redirect_fd, ?out: ::Kernel::redirect_fd, ?err: ::Kernel::redirect_fd, ?close_others: ::boolish, ?chdir: ::String) -> (::NilClass | ::FalseClass | ::TrueClass)
│             | (::Hash[::string, (::string | nil)], ::String, *::String, ?unsetenv_others: ::boolish, ?pgroup: (true | ::Integer), ?umask: ::Integer, ?in: ::Kernel::redirect_fd, ?out: ::Kernel::redirect_fd, ?err: ::Kernel::redirect_fd, ?close_others: ::boolish, ?chdir: ::String) -> (::NilClass | ::FalseClass | ::TrueClass)
│
│ Diagnostic ID: Ruby::UnresolvedOverloading
│
└         system("gcc -E #{include_args} #{header_file} -o #{dist_preprocessed_header_file}", exception: true)
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
… argument of type `(:ref | nil)`

```
lib/ruby_header_parser/parser.rb:223:57: [error] Cannot pass a value of type `(:ref | :raw | nil)` as an argument of type `(:ref | nil)`
│   (:ref | :raw | nil) <: (:ref | nil)
│     :raw <: (:ref | nil)
│       :raw <: :ref
│
│ Diagnostic ID: Ruby::ArgumentTypeMismatch
│
└       TyperefDefinition.new(type: typeref_type, pointer: typeref_pointer)
                                                           ~~~~~~~~~~~~~~~

```
…gument of type `(:ref | :array | nil)`

```
lib/ruby_header_parser/parser.rb:289:8: [error] Cannot pass a value of type `(::Symbol | nil)` as an argument of type `(:ref | :array | nil)`
│   (::Symbol | nil) <: (:ref | :array | nil)
│     ::Symbol <: (:ref | :array | nil)
│       ::Symbol <: :ref
│
│ Diagnostic ID: Ruby::ArgumentTypeMismatch
│
└         pointer:,
          ~~~~~~~
```
…join`

```
lib/ruby_header_parser/parser.rb:304:55: [error] Type `(::Array[::String] | nil)` does not have method `join`
│ Diagnostic ID: Ruby::NoMethod
│
└       original_type = Util.sanitize_type(parts[0...-1].join(" "))
                                                         ~~~~
```
```
lib/ruby_header_parser/parser.rb:238:58: [error] Type `(::String | nil)` does not have method `gsub`
│ Diagnostic ID: Ruby::NoMethod
│
└           definition[0...definition.index(function_name)].gsub("char *", "char*").strip
                                                            ~~~~
```
```
lib/ruby_header_parser/parser.rb:357:29: [error] Type `(::String | nil)` does not have method `length`
│ Diagnostic ID: Ruby::NoMethod
│
└       ::Regexp.last_match(1).length
                               ~~~~~~
```
… an argument of type `::String`

```
lib/ruby_header_parser/parser.rb:257:58: [error] Cannot pass a value of type `::Hash[::Symbol, bool]` as an argument of type `::String`
│   ::Hash[::Symbol, bool] <: ::String
│     ::Object <: ::String
│       ::BasicObject <: ::String
│
│ Diagnostic ID: Ruby::ArgumentTypeMismatch
│
└       lines = File.open(filepath, "rb") { |f| f.readlines(chomp: true) }
                                                            ~~~~~~~~~~~
```
@sue445 sue445 marked this pull request as ready for review October 13, 2024 06:54
@sue445 sue445 merged commit 03f9334 into main Oct 13, 2024
4 checks passed
@sue445 sue445 deleted the feature/add_sig branch October 13, 2024 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore updates (Not included in release note)
1 participant