Skip to content

[4.1] SILGen: Open existential lvalues on entry into an OpenExistentialExpr again. #14460

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

Conversation

jckarter
Copy link
Contributor

@jckarter jckarter commented Feb 7, 2018

Explanation: Fixes a regression in handling calls to mutating protocol extension methods with default arguments.

Scope: Regression from 4.0

Issue: rdar://problem/37031037

Risk: Low, a bug fix.

Testing: Swift CI, test case from Radar

Reviewed by: @rjmccall

@jckarter
Copy link
Contributor Author

jckarter commented Feb 7, 2018

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Feb 7, 2018

Build failed
Swift Test Linux Platform
Git Sha - b58a1d9f1e5ad443b15d52d40834cf529ccdabe5

@swift-ci
Copy link
Contributor

swift-ci commented Feb 7, 2018

Build failed
Swift Test OS X Platform
Git Sha - b58a1d9f1e5ad443b15d52d40834cf529ccdabe5

… again.

4b25945 changed codegen for lvalue OpenExistentialExprs so that the existential was not opened until the OpaqueValue's lvalue was evaluated, but this is incorrect—we need to open the dynamic type of the existential immediately since it can be used arbitrarily within the subexpression. This caused a regression when evaluating default argument generators on protocol extension methods (rdar://problem/37031037), and would become a bigger problem when we generalize the ability to open existentials.
@jckarter jckarter force-pushed the open-existential-lvalue-evaluation-order-4.1 branch from b58a1d9 to f310e5d Compare February 7, 2018 20:59
@jckarter
Copy link
Contributor Author

jckarter commented Feb 7, 2018

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Feb 7, 2018

Build failed
Swift Test OS X Platform
Git Sha - b58a1d9f1e5ad443b15d52d40834cf529ccdabe5

@swift-ci
Copy link
Contributor

swift-ci commented Feb 7, 2018

Build failed
Swift Test Linux Platform
Git Sha - b58a1d9f1e5ad443b15d52d40834cf529ccdabe5

@jckarter jckarter merged commit 662d5fd into swiftlang:swift-4.1-branch Feb 8, 2018
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.

2 participants