Sha256: bb914ed1a42ddb932cf80f26900715bd148b1a85f387284744ed8910a76f0b24

Contents?: true

Size: 300 Bytes

Versions: 3

Compression:

Stored size: 300 Bytes

Contents

def foo(n)
  if n.respond_to?(:times)
    n.times {|_| n = :sym }
  elsif n.respond_to?(:+)
    n + "foo"
  else
    n & false
  end
end


foo(1)
foo("str")
foo(true)

# no error expected

__END__
# Classes
class Object
  private
  def foo: (Integer | String | true) -> (Integer | String | bool)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
typeprof-0.9.2 smoke/respond_to.rb
typeprof-0.9.1 smoke/respond_to.rb
typeprof-0.9.0 smoke/respond_to.rb