Skip to content

Let errors in inspect raise #159

@JoshCheek

Description

@JoshCheek
class A
  def initialize(x, y)
    @x, @y = x, y
  end

  # What user intended:
  def inspect
    "#{self.class}.new(#{@x}, #{@y})"
  end
  new 123, 456 # => A.new(123, 456)

  # What user did, SiB hides this, which, in practice, has never been what I've
  # wanted it to do over 10 years or so... soooooo let the error raise?!
  def inspect
    "#{self.class}.new(#{x}, #{y})"
  end
  new 123, 456 # => #<A:0x00000001428bb4e0 @x=123, @y=456>
end

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