Skip to content

Add a convenience PatternBindingDecl::createImplicit member and mark some PBDs as implicit #17441

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

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Jun 22, 2018

Previously, some PBDs weren't being marked implicit even though the associated vars were implicit. PatternBindingDecl::createImplicit will be even nicer when we start storing the location of the equals token.

@hamishknight
Copy link
Contributor Author

I wasn't sure about two PBDs in TypeCheckRepl.cpp:

https://github.com/apple/swift/blob/8ba30d7ea858fe75c39a81a3f4705ae03d2ec352/lib/Sema/TypeCheckREPL.cpp#L310-L323

and

https://github.com/apple/swift/blob/8ba30d7ea858fe75c39a81a3f4705ae03d2ec352/lib/Sema/TypeCheckREPL.cpp#L384-L399

Currently neither variable nor pattern binding decl are marked implicit – should they be?

@jrose-apple
Copy link
Contributor

TypeCheckREPL isn't super important, since it's only for the deprecated REPL. "Implicit" pretty much just means "this shouldn't be printed in a generated interface"*, and that's not going to matter much for these synthetic variables. But if it simplifies the code go ahead and clean it up.

* "Implicit" does imply that the compiler synthesized the declaration as well, but there are non-implicit compiler-synthesized declarations too.

@hamishknight
Copy link
Contributor Author

@jrose-apple Ah okay, I see – thanks for clarifying! I think I'll leave them as-is in that case as I don't think it would be a simplification.

@hamishknight hamishknight force-pushed the implicit-pattern-binding-decls branch from 465d869 to bc00026 Compare June 22, 2018 22:24
…some PBDs as implicit

Previously, some PBDs weren't being marked implicit even though the associated vars were implicit. PatternBindingDecl::createImplicit will be even nicer when we start parsing the location of the equals token.
@hamishknight hamishknight force-pushed the implicit-pattern-binding-decls branch from bc00026 to f33844d Compare July 2, 2018 13:29
@hamishknight
Copy link
Contributor Author

Just rebased to resolve a merge conflict.

@jrose-apple
Copy link
Contributor

@swift-ci Please smoke test

@jrose-apple jrose-apple self-assigned this Jul 2, 2018
@jrose-apple jrose-apple merged commit 893d331 into swiftlang:master Jul 2, 2018
@hamishknight hamishknight deleted the implicit-pattern-binding-decls branch July 2, 2018 17:49
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