Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/typeprof/core/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ class Array[Elem]
class Hash[K, V]
include _Each[[K, V]]
end
class Object
include Hash::_Key
end
RBS

# Loading frequently used modules first will reduces constant resolution
Expand Down
16 changes: 16 additions & 0 deletions scenario/hash/key_check.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## update
def test
h = { a: 1, b: 2 }
h.key?(:a)
h.key?("not a symbol")
h.key?(Object.new)
end

test

## assert
class Object
def test: -> bool
end

## diagnostics
Loading