Sha256: 21de141e60d1f82a0bee099ec904ece7c748029b282fc045f8f49a6403b18f1d

Contents?: true

Size: 733 Bytes

Versions: 20

Compression:

Stored size: 733 Bytes

Contents

# @type var x: Integer | String | Symbol

x = (_ = nil)

case x
when Integer, String
  # !expects NoMethodError: type=(::Integer | ::String), method=foobar
  x.foobar()
end

case x == (_ = 1)
when Integer
  # !expects NoMethodError: type=(::Integer | ::String | ::Symbol), method=foobar
  x.foobar
end

case x
when 1
  # !expects NoMethodError: type=(::Integer | ::String | ::Symbol), method=foobar
  x.foobar
end

case x
when String
  # !expects@+2 IncompatibleAnnotation: var_name=x, ::Integer <: ::String
  # @type var x: Integer
  x + 1
end

case x
when Object
  # !expects@+2 IncompatibleTypeCase: var_name=x, ::Object <: (::Integer | ::String | ::Symbol)
  # !expects NoMethodError: type=::Object, method=foobar
  x.foobar
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
steep-0.28.0 smoke/type_case/a.rb
steep-0.27.0 smoke/type_case/a.rb
steep-0.25.0 smoke/type_case/a.rb
steep-0.24.0 smoke/type_case/a.rb
steep-0.23.0 smoke/type_case/a.rb
steep-0.22.0 smoke/type_case/a.rb
steep-0.21.0 smoke/type_case/a.rb
steep-0.20.0 smoke/type_case/a.rb
steep-0.19.0 smoke/type_case/a.rb
steep-0.18.0 smoke/type_case/a.rb
steep-0.17.1 smoke/type_case/a.rb
steep-0.17.0 smoke/type_case/a.rb
steep-0.16.3 smoke/type_case/a.rb
steep-0.16.2 smoke/type_case/a.rb
steep-0.16.1 smoke/type_case/a.rb
steep-0.16.0 smoke/type_case/a.rb
steep-0.15.0 smoke/type_case/a.rb
steep-0.14.0 smoke/type_case/a.rb
steep-0.13.0 smoke/type_case/a.rb
steep-0.12.0 smoke/type_case/a.rb