HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/rubies/default/lib/ruby/gems/3.0.0/gems/typeprof-0.12.0/smoke/attr-vis.rb
class Foo
  def initialize
    @foo = 42
  end

  private
  attr_accessor :foo

  public
  def get_foo
    foo
  end
  def set_foo(arg)
    self.foo = arg
  end
  def get_bar
    bar
  end
  def set_bar(arg)
    self.bar = arg
  end
end

Foo.new.set_foo("str")
Foo.new.set_bar("str")

__END__
# Errors
smoke/attr-vis.rb:20: [warning] inconsistent assignment to RBS-declared variable

# Classes
class Foo
  def initialize: -> Integer

  private
  attr_accessor foo: Integer | String

  public
  def get_foo: -> (Integer | String)
  def set_foo: (String arg) -> String
  def get_bar: -> Integer
  def set_bar: (String arg) -> String
end