Sha256: 887af411ae20918dffdba3d8cc184fad5e34df3226d9d269b0898aef07d82529

Contents?: true

Size: 518 Bytes

Versions: 8

Compression:

Stored size: 518 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
  def foo : -> ([:a | untyped, :b | untyped])
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
typeprof-0.7.0 smoke/pattern-match1.rb
typeprof-0.6.1 smoke/pattern-match1.rb
typeprof-0.6.0 smoke/pattern-match1.rb
typeprof-0.5.4 smoke/pattern-match1.rb
typeprof-0.5.3 smoke/pattern-match1.rb
typeprof-0.5.2 smoke/pattern-match1.rb
typeprof-0.5.1 smoke/pattern-match1.rb
typeprof-0.5.0 smoke/pattern-match1.rb