Skip to content

Conversation

@asl
Copy link
Contributor

@asl asl commented May 21, 2025

Fixes #81608

@asl asl requested review from kovdan01 and rxwei May 21, 2025 08:31
@asl asl requested a review from eeckstein as a code owner May 21, 2025 08:31
@asl
Copy link
Contributor Author

asl commented May 21, 2025

@swift-ci please test

@asl asl added the AutoDiff label May 21, 2025
@asl asl changed the title Better diagnose non-differentiability for throwing functions [AutoDiff] Better diagnose non-differentiability for throwing functions May 21, 2025
Copy link
Contributor

@kovdan01 kovdan01 left a comment

Choose a reason for hiding this comment

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

As far as I see, we now have 3 new code paths leading to non-differentiability diagnostics, while only 1 is covered by test. It's probably worth adding tests for all the 3 code paths (if that's not too challenging)

Except this, LGTM

@asl
Copy link
Contributor Author

asl commented May 21, 2025

As far as I see, we now have 3 new code paths leading to non-differentiability diagnostics, while only 1 is covered by test. It's probably worth adding tests for all the 3 code paths (if that's not too challenging)

Except this, LGTM

In fact two, as currently there is no way getSingleTerminator would return nullptr. Still, if new terminators would be added in the future it would be better not to crash here. And as for move_value we previously decided with you to ignore that case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

3 participants