This review is focused only on source compatibility. I read that section in depth and skimmed the rest of the propasal. I did not read all of the review thread or previous discussion.
When upgrading to Swift 4.2, Hashable types written for earlier versions of Swift will need to be migrated to implement hash(into:) instead of hashValue. There are two options for doing this:
IIUC, we will synthesize the new hash(into:)
based on the user's hashValue
implementation when using the pre-4.2 language mode. Why not do the same in 4.2 and deprecate hashValue
instead of forcing users to update it immediately? A warning combined with excellent fixits is a great way to get everyone to migrate over time, but it's painful for it to become an error in the same release that the new functionality is added. The bar for making it an error in 4.2 should be that we can migrate it fully automatically, but...
The compiler should simplify the migration process by providing fix-its for both options. A fix-it to remove hashValue should only be provided if automatic synthesis is available. For the second option, it would be nice to have the compiler suggest a full implementation of hash(into:), but a template would probably suffice:
... I believe this is not sufficient for automatic migration. We will not be able to ensure that the behaviour of the program doesn't change with either of these options. I think we really need the user to make the decision to change their hashing.