Sha256: c5dd40c7c9fa4e5bd725e9b22407ab0ef86a6e4d844b9a600e634142057c158d

Contents?: true

Size: 291 Bytes

Versions: 18

Compression:

Stored size: 291 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
  def foo : (Integer | String | true) -> (Integer | String | bool)
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
typeprof-0.7.0 smoke/respond_to.rb
typeprof-0.6.1 smoke/respond_to.rb
typeprof-0.6.0 smoke/respond_to.rb
typeprof-0.5.4 smoke/respond_to.rb
typeprof-0.5.3 smoke/respond_to.rb
typeprof-0.5.2 smoke/respond_to.rb
typeprof-0.5.1 smoke/respond_to.rb
typeprof-0.5.0 smoke/respond_to.rb
typeprof-0.4.2 smoke/respond_to.rb
typeprof-0.4.1 smoke/respond_to.rb
typeprof-0.4.0 smoke/respond_to.rb
typeprof-0.3.0 smoke/respond_to.rb
typeprof-0.2.0 smoke/respond_to.rb
typeprof-0.1.4 smoke/respond_to.rb
typeprof-0.1.3 smoke/respond_to.rb
typeprof-0.1.2 smoke/respond_to.rb
typeprof-0.1.1 smoke/respond_to.rb
typeprof-0.1.0 smoke/respond_to.rb