Skip to content

Do not restore the precedencegroup name when deserializing them. #19787

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
Oct 9, 2018
Merged

Do not restore the precedencegroup name when deserializing them. #19787

merged 1 commit into from
Oct 9, 2018

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Oct 9, 2018

We only need to have the identifier during type checking of operator
declarations, so we do not need to restore it from the
PrecedenceGroupDecl during deserialization. We can just use the
deserialized name from the PrecedenceGroupDecl directly if needed.

This does result in one change in behavior. When printing modules, we
previously didn't print 'DefaultPrecedence' for items that had no
precedence specified, but now we will as seen in the test update for
IDE/print_ast_tc_decls.swift.

We only need to have the identifier during type checking of operator
declarations, so we do not need to restore it from the
PrecedenceGroupDecl during deserialization. We can just use the
deserialized name from the PrecedenceGroupDecl directly if needed.

This does result in one change in behavior. When printing modules, we
previously didn't print 'DefaultPrecedence' for items that had no
precedence specified, but now we will as seen in the test update for
IDE/print_ast_tc_decls.swift.
@rudkx rudkx requested a review from benlangmuir October 9, 2018 04:22
@rudkx
Copy link
Contributor Author

rudkx commented Oct 9, 2018

@benlangmuir I'm not sure how faithful we're attempting to be with the input source in module printing. Does the output different in the test case that I updated matter?

@rudkx
Copy link
Contributor Author

rudkx commented Oct 9, 2018

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor

I think the textual module interface printing stuff will print deserialized decls when you’re producing a textual interface in non-WMO mode because the printing is performed during the merge modules phase. Cc @harlanhaskins

@harlanhaskins
Copy link
Contributor

harlanhaskins commented Oct 9, 2018

@slavapestov Yep, and I think this behavior change should be okay for that, provided we aren’t losing information. This does however highlight the lack of tests for operator decls in test/ParseableInterface/. Also, do we currently print the operator protocol work you did recently, @rudkx?

@rudkx
Copy link
Contributor Author

rudkx commented Oct 9, 2018

@harlanhaskins We print that type, but I don't think we have tests for it yet. I'm working on enhancing it to allow for multiple types to be specified, and will make sure I add some printing tests when I do that.

@rudkx rudkx merged commit dd711e8 into swiftlang:master Oct 9, 2018
@rudkx rudkx deleted the extend-operator-designated-type branch October 9, 2018 13:51
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