Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Jan 30, 2026

Rationale for this change

The TypeEquals() function has a fallback path for types without fingerprints, but it was not passing through the check_metadata parameter to TypeEqualsVisitor. While this is an really rare corner case, the check should still be there to prevent potential mistakes when, e.g., adding new types in the future.

What changes are included in this PR?

  • Added test case TestNestedType.FieldMetadataComparisonWithEmptyFingerprints to verify the fix
  • Updated the TODO comment to clarify why the parameter must be passed through.

Are these changes tested?

Yes, unittest was added.

Are there any user-facing changes?

No.

AssertFieldNotEqual(*u0, *u0_bad);
}

TEST(TestNestedType, FieldMetadataComparisonWithEmptyFingerprints) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be too much. I am fine with removing this test case if anyone thinks so. It's more to demonstrate the case of triggering check_metadata.

@github-actions github-actions bot added awaiting review Awaiting review Component: C++ awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant