Sha256: 591e0686350e6af994973e91d3c8c41403c5d9cd0a419d58cb7a4515c0be0de9

Contents?: true

Size: 643 Bytes

Versions: 9

Compression:

Stored size: 643 Bytes

Contents

# This code is created by simplifying matrix.rb.
# The issue occurs when `Array.new` creates a cell-type container,
# so this test will be obsolete, but keep it just for case of regression.
#
# https://github.com/ruby/typeprof/issues/14

class Foo
  def initialize(ivar)
    @ivar = ivar
  end

  def foo(n)
    @ivar.each_with_index { }
    nil
  end
end

Foo.new([])

rows = Array.new(1) do |i|
  Array.new(1) do |j|
    "str"
  end
end
obj = Foo.new(rows)

obj.foo(:a)
obj.foo(:b)

__END__
# Classes
class Foo
  @ivar : Array[Array[String]]
  def initialize : (Array[Array[String]]) -> Array[Array[String]]
  def foo : (:a | :b) -> nil
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
typeprof-0.8.0 smoke/rbs-tyvar4.rb
typeprof-0.7.0 smoke/rbs-tyvar4.rb
typeprof-0.6.1 smoke/rbs-tyvar4.rb
typeprof-0.6.0 smoke/rbs-tyvar4.rb
typeprof-0.5.4 smoke/rbs-tyvar4.rb
typeprof-0.5.3 smoke/rbs-tyvar4.rb
typeprof-0.5.2 smoke/rbs-tyvar4.rb
typeprof-0.5.1 smoke/rbs-tyvar4.rb
typeprof-0.5.0 smoke/rbs-tyvar4.rb