Skip to content

[AutoDiff] [Sema] Fix a 'EuclideanDifferentiable' derived conformances crasher. #26900

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

Merged
merged 1 commit into from
Aug 28, 2019

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented Aug 28, 2019

Resolves TF-783.

@rxwei rxwei added the tensorflow This is for "tensorflow" branch PRs. label Aug 28, 2019
@rxwei rxwei requested a review from dan-zheng August 28, 2019 04:36
@rxwei
Copy link
Contributor Author

rxwei commented Aug 28, 2019

@swift-ci please test tensorflow

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.

Nice find 👍

@@ -404,13 +404,14 @@ static ValueDecl *deriveEuclideanDifferentiable_differentiableVectorView(
eucDiffProto->lookupDirect(C.Id_differentiableVectorView).front();

SmallVector<VarDecl *, 8> diffProperties;
getStoredPropertiesForDifferentiation(nominal, nominal->getDeclContext(),
Copy link
Contributor

Choose a reason for hiding this comment

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

parentDC as the second argument is correct.

For reference, nominal->getDeclContext() returns the parent context of the NominalDecl - passing just nominal would be closer to correct.

@rxwei rxwei merged commit e477fca into swiftlang:tensorflow Aug 28, 2019
@rxwei rxwei deleted the fix-eucdiff-crash branch August 28, 2019 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tensorflow This is for "tensorflow" branch PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants