Skip to content
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

RBS additions #1

Merged
merged 17 commits into from
Jan 8, 2024
Merged

Commits on Jan 2, 2024

  1. Configuration menu
    Copy the full SHA
    1bb1f0c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    45c283a View commit details
    Browse the repository at this point in the history
  3. Avoid rb_class_new_instance() here, to avoid passing the method block

    rb_class_new_instance() automatically passes the block forward to the initialize method.
    That way the block of a callback is forwarded to the Struct initializer, like here in the specs:
    
          s = LibTest::S8F32S32.new
          ret = LibTest.testCallbackVrT { s }
    
    Struct#initialize ignores the block, so that the code works, but it doesn't make sense.
    
    This stood up when enabling rbs type checks, which complained about an unspecified block to Struct#initialize.
    larskanis committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    5b4b406 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    907f236 View commit details
    Browse the repository at this point in the history
  5. Various adjustments to rbs definitions

    They stood up when running with rbs type checks enabled.
    larskanis committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    5220fb5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fb26374 View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2024

  1. Fix Struct::layout

    ParadoxV5 committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    4868bfa View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. Move typedef, type_find and related methods around

    For better readability.
    And add some comments.
    larskanis committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    d9af6dc View commit details
    Browse the repository at this point in the history
  2. Avoid rb_class_new_instance() here, to avoid passing the method block

    Similar to commit 5b4b406
    
    rb_class_new_instance() automatically passes the block forward to the initialize method.
    That way the block of an array function is forwarded to the Struct initializer.
    Struct#initialize ignores the block, so that the code works, but it doesn't make sense.
    
    This stood up when enabling rbs type checks, which complained about an unspecified block to Struct#initialize.
    larskanis committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    7bd1aa4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    30ddc6a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7c7178e View commit details
    Browse the repository at this point in the history
  5. RBS: Fix errors in puts kind of:

      11) MemoryPointer allows writing as a sized int
          Failure/Error: put(type, 0, value)
    
          RBS::Test::Tester::TypeError:
            TypeError: [FFI::AbstractMemory#put] ArgumentTypeError: expected `bot` (value) but given `1`
    larskanis committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    947755e View commit details
    Browse the repository at this point in the history
  6. RBS: Fix errors in write kind of:

      11) MemoryPointer allows writing as a sized int
          Failure/Error: m.write :uint32, 1
    
          RBS::Test::Tester::TypeError:
            TypeError: [FFI::Pointer#write] ArgumentTypeError: expected `bot` (value) but given `1`
          # /home/lars/.rvm/gems/ruby-3.3.0/gems/rbs-3.4.1/lib/rbs/test/tester.rb:158:in `call'
          # /home/lars/.rvm/gems/ruby-3.3.0/gems/rbs-3.4.1/lib/rbs/test/observer.rb:10:in `notify'
          # /home/lars/.rvm/gems/ruby-3.3.0/gems/rbs-3.4.1/lib/rbs/test/hook.rb:178:in `ensure in write__with__RBS_TEST_eb5149_4888829b'
          # /home/lars/.rvm/gems/ruby-3.3.0/gems/rbs-3.4.1/lib/rbs/test/hook.rb:178:in `write__with__RBS_TEST_eb5149_4888829b'
          # ./spec/ffi/rbx/memory_pointer_spec.rb:65:in `block (2 levels) in <top (required)>'
          # ------------------
          # --- Caused by: ---
          # RBS::Test::Tester::TypeError:
          #   TypeError: [FFI::AbstractMemory#put] ArgumentTypeError: expected `bot` (value) but given `1`
          #   /home/lars/.rvm/gems/ruby-3.3.0/gems/rbs-3.4.1/lib/rbs/test/tester.rb:158:in `call'
    larskanis committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    2b22a62 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a014273 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a44eba5 View commit details
    Browse the repository at this point in the history
  9. RBS: declare initialize methods as returning void

    By convention as discussed in ParadoxV5#1 (comment)
    larskanis committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    eebe26a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ff9d8e9 View commit details
    Browse the repository at this point in the history