Copilot commented on code in PR #3700:
URL: https://github.com/apache/thrift/pull/3700#discussion_r3704794500


##########
lib/rb/spec/struct_spec.rb:
##########
@@ -212,6 +225,27 @@ def validate_default_arguments(object)
       }.to raise_error(sentinel)
     end
 
+    [
+      ['map', Thrift::Types::MAP, 5, :read_map_begin, [Thrift::Types::I32, 
Thrift::Types::MAP]],
+      ['list', Thrift::Types::LIST, 4, :read_list_begin, [Thrift::Types::I32]],
+      ['set', Thrift::Types::SET, 6, :read_set_begin, [Thrift::Types::I16]]
+    ].each do |name, field_type, field_id, begin_method, header|

Review Comment:
   `read_map_begin` is expected to return `[key_type, value_type, size]`, but 
the test’s `header` for the map case uses `Thrift::Types::MAP` as the *value 
type*. That makes the declared map header inconsistent (value type should be a 
concrete element type like `Thrift::Types::I32`), and can cause the struct 
reader to take the “type mismatch / skip” path instead of attempting to read 
entries, invalidating what this spec is trying to assert. Update the map header 
to use a valid value type consistent with the field definition (e.g., 
`[Thrift::Types::I32, Thrift::Types::I32]` if both key/value are i32).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to