Skip to content

Commit

Permalink
Merge pull request #1463 from ruby/fix-fiber-storage-types
Browse files Browse the repository at this point in the history
String keys are forbidden.
  • Loading branch information
soutaro committed Aug 25, 2023
2 parents ed3ac5b + 6013052 commit d86111e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions core/fiber.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Fiber < Object
#
# See also Fiber::[]=.
#
def self.[]: (Symbol | String) -> untyped
def self.[]: (Symbol) -> untyped

# <!--
# rdoc-file=cont.c
Expand All @@ -99,7 +99,7 @@ class Fiber < Object
#
# See also Fiber::[].
#
def self.[]=: [A] (Symbol | String, A) -> A
def self.[]=: [A] (Symbol, A) -> A

# <!--
# rdoc-file=cont.c
Expand Down
12 changes: 0 additions & 12 deletions test/stdlib/Fiber_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ def test_aref
"(Symbol) -> Integer",
Fiber, :[], :key
)

key = "string"

assert_send_type(
"(String, Integer) -> Integer",
Fiber, :[]=, key, 123
)

assert_send_type(
"(String) -> Integer",
Fiber, :[], key
)
end

def test_blocking?
Expand Down

0 comments on commit d86111e

Please sign in to comment.