Skip to content

Add Transitive casting and testing code #1252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BenFordTytherington
Copy link
Collaborator

@BenFordTytherington BenFordTytherington commented Apr 8, 2025

Adds macros for implementing transitive casting, for 3 types, or a longer chain.
For 3 types A, B and C, impl_transitive_cast! will implement casting between A -> C, provided the relations between exist. For a longer chain, use chain_cast!.

These are scoped to cxx_qt due to #[macro_export], but Upcast has now also become unsafe and moved into a casting module, use it like so: use cxx_qt::casting::Upcast.

Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5d3b2de) to head (7baae3e).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1252   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           73        73           
  Lines        12634     12634           
=========================================
  Hits         12634     12634           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@BenFordTytherington BenFordTytherington force-pushed the add-transitive-casting branch 3 times, most recently from 2cea6c4 to 3da5070 Compare April 25, 2025 17:09
@BenFordTytherington BenFordTytherington force-pushed the add-transitive-casting branch 2 times, most recently from 0450dd2 to ef5aab3 Compare May 2, 2025 12:25
@BenFordTytherington BenFordTytherington marked this pull request as ready for review May 2, 2025 12:35
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