Skip to content

Fix the emission of open-existential-metatype l-values #9852

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

Conversation

rjmccall
Copy link
Contributor

rdar://32288618

@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test and merge.

@rjmccall rjmccall force-pushed the open-existential-metatype-lvalue branch from 6e24ca7 to bb5fe80 Compare May 23, 2017 00:47
@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test and merge.

@slavapestov
Copy link
Contributor

Thanks for fixing this! There might be a simpler solution though, to have Sema coerce the base to an rvalue if its a metatype. You cannot have a mutating static method after all.

@rjmccall
Copy link
Contributor Author

That's true, but the fix seems reasonable, and I'm reluctant to add any extra requirements to CSApply's treatments of member expressions. :)

@rjmccall
Copy link
Contributor Author

@swift-ci Please smoke test.

@rjmccall
Copy link
Contributor Author

Honestly, in general I feel a lot more comfortable with doing heroics in SILGen, where we implement most of Swift's evaluation semantics anyway, than in Sema, where we often have to come up with super-awkward abstractions just to make things fit the conceit of a syntax tree. It would be much simpler if CSApply just assigned each source expression a type and then, maybe, recorded how to do a particular implicit conversion in some way that didn't interfere so much with the expression tree.

@rjmccall rjmccall merged commit 48d60a4 into swiftlang:master May 23, 2017
@rjmccall rjmccall deleted the open-existential-metatype-lvalue branch May 23, 2017 05:27
@rjmccall
Copy link
Contributor Author

Hmm. The downside is that I can't really pull this change into swift-4.0-branch without pulling at least #9637.

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