Skip to content

Fix overload conflict avoidance for Index / IndexMut.#1083

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_921550952
Open

Fix overload conflict avoidance for Index / IndexMut.#1083
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_921550952

Conversation

@copybara-service
Copy link
Copy Markdown

Fix overload conflict avoidance for Index / IndexMut.

Before this CL, only top-level types would be analyzed for potential
conflicts (e.g. usize and u64 may both map to the same C++ type).
This means that conflicts involving nested types may go unnoticed,
leading to C++ compilation errors (e.g. when (usize, bool) and
(u64, bool) tuple types both map to the same C++ type).

This CL fixes this:

  • The conflict avoidance code was moved into a small, separate crate
    for additional encapsulation and unit test coverage.
  • The conflict avoidance code was made independent of usize / isize
    (based on the concept of a "vip" type).
  • Recursive destructuring of types has been added to the get_vip
    function

Before this CL, only top-level types would be analyzed for potential
conflicts (e.g. `usize` and `u64` may both map to the same C++ type).
This means that conflicts involving nested types may go unnoticed,
leading to C++ compilation errors (e.g. when `(usize, bool)` and
`(u64, bool)` tuple types both map to the same C++ type).

This CL fixes this:

* The conflict avoidance code was moved into a small, separate crate
  for additional encapsulation and unit test coverage.
* The conflict avoidance code was made independent of `usize` / `isize`
  (based on the concept of a "vip" type).
* Recursive destructuring of types has been added to the `get_vip`
  function

PiperOrigin-RevId: 921550952
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant