Skip to content

Conversation

harlanhaskins
Copy link
Contributor

@harlanhaskins harlanhaskins commented Dec 12, 2018

Instead of only printing through the pattern binding, and potentially missing stored properties with property observers, defer to the pattern binding for all stored properties, and print accessors if applicable while printing pattern bindings.

Fallout from rdar://43815861

@harlanhaskins
Copy link
Contributor Author

@swift-ci please test

@harlanhaskins harlanhaskins force-pushed the what-does-pc-load-letter-even-mean branch from e943288 to b828ea3 Compare December 12, 2018 23:30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this if should probably be guarding the next section…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this was left over from the original implementation. I'll just go ahead and change it. Should we even have the option to turn it off, now that var initializers are part of the public interface anyway?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I…guess not? Although I suppose we could have an option that chooses between "all of them" and "only the ones that are public".

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e943288df723c1f9246e219365803ce8244f714d

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment stating why this whole mess is necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it'll print the same entry twice when there are two VarDecls in the same entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might just be more profitable and cleaner to figure out when we print a single VarDecl without going through the pattern binding. That's what's really happening here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That _hasInitialValue is suspicious. We shouldn't present that knowledge in a resilient struct. (And arguably not in a fragile struct either, but let's not worry about that right now.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense -- that's the existing behavior, so I'll fix that in a follow-up patch.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e943288df723c1f9246e219365803ce8244f714d

@harlanhaskins harlanhaskins force-pushed the what-does-pc-load-letter-even-mean branch from b828ea3 to 2f13f1b Compare December 13, 2018 00:53
@harlanhaskins
Copy link
Contributor Author

@jrose-apple This should be much simpler.

Don’t print var initializers if `Options.VarInitializers` is false.
@harlanhaskins harlanhaskins force-pushed the what-does-pc-load-letter-even-mean branch from 2f13f1b to 05f7cdb Compare December 13, 2018 01:12
@harlanhaskins harlanhaskins force-pushed the what-does-pc-load-letter-even-mean branch from 05f7cdb to b3e6f1a Compare December 13, 2018 01:14
@jrose-apple
Copy link
Contributor

Your test case got lost.

@harlanhaskins harlanhaskins force-pushed the what-does-pc-load-letter-even-mean branch from b3e6f1a to 0b62614 Compare December 13, 2018 01:22
@harlanhaskins
Copy link
Contributor Author

@jrose-apple Thanks!

@harlanhaskins
Copy link
Contributor Author

@swift-ci please test and merge

…h storage

Instead of only printing through the pattern binding, and potentially missing stored properties with property observers, defer to the pattern binding for all stored properties, and print accessors if applicable while printing pattern bindings.
@harlanhaskins harlanhaskins force-pushed the what-does-pc-load-letter-even-mean branch from 0b62614 to 7fe74b2 Compare December 13, 2018 18:15
@harlanhaskins
Copy link
Contributor Author

@swift-ci please test and merge

@harlanhaskins
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b828ea31e6d1d0685d659b833699519c0e591855

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b828ea31e6d1d0685d659b833699519c0e591855

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