Skip to content

On using Argument Forwarding with Doc style syntax, behavior is unexpected #145

@sanfrecce-osaka

Description

@sanfrecce-osaka

On using Argument Forwarding with Doc style syntax, behavior is unexpected.

class Foo
  # @rbs id: Integer
  # @rbs return: void
  def self.execute(...)
    new(...).execute
  end

  # @rbs @id: Integer

  # @rbs id: Integer
  # @rbs return: void
  def initialize(id)
    @id = id
  end

  # @rbs return: void
  def execute
    # ...
  end
end

Expected behavior

It produces the following output.

class Foo
  def self.execute: (Integer id) -> void

  @id: Integer

  def initialize: (Integer id) -> void

  def execute: () -> void
end

Actual behavior

It produces the following output.

class Foo
  def self.execute: () -> void

  @id: Integer

  def initialize: (Integer id) -> void

  def execute: () -> void
end

On the other hand, # @rbs and # : syntaxes produce the expected output.

System configuration

  • rbs v3.6.1
  • rbs-inline v0.10.0
  • steep v1.8.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions