Sha256: 9630b50a1775d3e003c65cfa169ae870461f4d8e32a7cd6669068b813423887c

Contents?: true

Size: 527 Bytes

Versions: 10

Compression:

Stored size: 527 Bytes

Contents

# RUBY_VERSION >= 3.0

def foo
  case [:a, :b, :c]
  in [a, b, :c]
    # Due to very subtle detail of bytecode, the variables "a" and "b" could be nil
    return a, b
  end
end

foo

__END__
# Errors
smoke/pattern-match1.rb:5: [error] undefined method: nil#length
smoke/pattern-match1.rb:5: [error] undefined method: nil#[]
smoke/pattern-match1.rb:5: [error] undefined method: nil#[]
smoke/pattern-match1.rb:5: [error] undefined method: nil#[]

# Classes
class Object
  private
  def foo: -> ([:a | untyped, :b | untyped])
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
typeprof-0.15.0 smoke/pattern-match1.rb
typeprof-0.14.1 smoke/pattern-match1.rb
typeprof-0.14.0 smoke/pattern-match1.rb
typeprof-0.13.0 smoke/pattern-match1.rb
typeprof-0.12.0 smoke/pattern-match1.rb
typeprof-0.11.0 smoke/pattern-match1.rb
typeprof-0.10.0 smoke/pattern-match1.rb
typeprof-0.9.2 smoke/pattern-match1.rb
typeprof-0.9.1 smoke/pattern-match1.rb
typeprof-0.9.0 smoke/pattern-match1.rb