Skip to content
Open
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/rbs/test/type_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ def value(val, type)
klass = get_class(type.name) or return false
if params = builder.env.normalized_module_class_entry(type.name.absolute!)&.type_params
args = AST::TypeParam.normalize_args(params, type.args)
if args.size != params.size
return false
end
unless args == type.args
type = Types::ClassInstance.new(name: type.name, args: args, location: type.location)
end
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/Array_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test_at
end

def test_bsearch
assert_send_type "() -> Enumerable[String, Integer?]", [0,1,2,3,4],
assert_send_type "() -> Enumerator[Integer]", [0,1,2,3,4],
:bsearch

assert_send_type "() { (Integer) -> (true | false) } -> Integer",
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/ObjectSpace_WeakKeyMap_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_clear
map = ObjectSpace::WeakKeyMap.new()

assert_send_type(
"() -> ::ObjectSpace::WeakKeyMap",
"() -> ::ObjectSpace::WeakKeyMap[::String, ::Integer]",
map, :clear
)
end
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/ObjectSpace_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_garbage_collect
def test_undefine_finalizer
assert_send_type "(String) -> String",
ObjectSpace, :undefine_finalizer, +"abc"
assert_send_type "(Array) -> Array",
assert_send_type "(Array[untyped]) -> Array[untyped]",
ObjectSpace, :undefine_finalizer, []
end

Expand Down