Skip to content

[4.2] Sema: Clear the types of exprs changed by collection upcast peepholes. #17685

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 Jul 3, 2018

Explanation: The compiler would crash when performing a bridging coercion on a nested collection literal.

Scope: Regression from Swift 4.1

Issue: rdar://problem/41040820

Risk: Low, targeted bug fix

Testing: Swift CI, compatibility suite

Reviewed by: @rudkx, @xedin

`finish{Array,Dictionary}Expr` currently invoke `cs.cacheExprTypes` after building their semantic exprs, which in a nested collection expression, immediately undoes the type changes done by this peephole, leading to crashes due to inconsistencies in the AST later. rdar://problem/41040820
@jckarter
Copy link
Contributor Author

jckarter commented Jul 3, 2018

@swift-ci Please test

@jckarter
Copy link
Contributor Author

jckarter commented Jul 3, 2018

@swift-ci Please test source compatibility

@jckarter
Copy link
Contributor Author

jckarter commented Jul 3, 2018

@swift-ci Please nominate

@jckarter jckarter merged commit 13f8098 into swiftlang:swift-4.2-branch Jul 3, 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.

1 participant