[swift-evolution] Revisiting SE-0110

Chris Lattner sabre at nondot.org
Sat Jun 17 11:57:06 CDT 2017

On Jun 17, 2017, at 9:18 AM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
> Fine by me as well, but to be clear this will be a non-trivial source breaking change.

I understand your desire for caution here, and I completely agree that we don’t want to accidentally break code.  As established up-thread, given the planned changes for SE-0155, enum pattern matching isn’t affected.

The only case I’m interested in “removing” is the label part of the productions for the tuple patterns.  I’m not suggesting we remove shuffling (sorry for mentioning that, it seemed to confuse the conversation), and agree that we can’t regress the enum case matching behavior, even if SE-0155 is not implemented.

Let me be super concrete about what I’m saying.  I propose:

1. In Swift 4 mode, start *warning* about tuple labels being deprecated (given that SE-0155 isn’t implemented, we’d filter out cases where they exist as an immediate child to an enum pattern).

2. Ship that warning in some "hopefully-soon” toolchain release and Xcode beta.

3. Look for feedback on unexpected cases where this triggers.

4. If the feedback is non-existent or the cases deemed “weird”, we could consider enabling the warning in Swift 3.2 mode as well.

In a subsequent release, we would consider upgrading the warning to an error to reject the code in a subsequent swift version, but I am not suggesting that we do that for Swift 4.


More information about the swift-evolution mailing list