Skip to content

Conversation

marcrasi
Copy link

As demonstrated in the new test file, we should reject derivative requirement implementations that are too constrained.

@marcrasi marcrasi requested a review from dan-zheng December 11, 2019 21:16
@marcrasi marcrasi force-pushed the marcrasi-unsatisfied-generic-requirement branch from 67c94b6 to 3480227 Compare December 11, 2019 21:17
@dan-zheng dan-zheng requested a review from rxwei December 11, 2019 21:30
Copy link
Contributor

@dan-zheng dan-zheng left a comment

Choose a reason for hiding this comment

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

This makes sense!

@marcrasi
Copy link
Author

@swift-ci please test tensorflow

@marcrasi
Copy link
Author

This seemed a bit risky, so I ran swift-apis tests on them. They passed.

@marcrasi
Copy link
Author

@swift-ci please test tensorflow macos

@marcrasi marcrasi merged commit 7ce8a41 into tensorflow Dec 12, 2019
@marcrasi marcrasi deleted the marcrasi-unsatisfied-generic-requirement branch December 12, 2019 02:20
@marcrasi marcrasi restored the marcrasi-unsatisfied-generic-requirement branch December 12, 2019 04:44
marcrasi pushed a commit that referenced this pull request Dec 12, 2019
This PR puts the generic signature of the original function in the `DifferentiableAttribute`, solving TF-1046.

This exposed 3 latent bugs, which I had to deal with:
* `getNextOverriddenVTableEntry` was returning a result with the generic signature of the overriding derivative, but it should return a result with the generic signature of the overridden derivative.
* TF-1055. Dealt with by adding a special case. See `TODO(TF-1055)` in the code.
* #28716 is incorrect for conditional conformances because the conformance condition (which is part of the witness generic signature) is not satisfied by the requirement. This PR exposed the incorrectness and caused some tests to fail. I fixed it by expanding the check from #28716 to accept witness requirements that are satisfied by the conformance condition.
@compnerd compnerd deleted the marcrasi-unsatisfied-generic-requirement branch May 31, 2025 20:33
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.

3 participants