swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.59k stars 10.37k forks source link

[SR-4316] Look for conformances that can be stripped #46899

Open dabrahams opened 7 years ago

dabrahams commented 7 years ago
Previous ID SR-4316
Radar None
Original Reporter @dabrahams
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | @eeckstein | |Priority | Medium | md5: 22a7f6d21e69e6611bb7955009021e42

Issue Description:

At a discussion over lunch today with @swiftix, @eeckstein, and Joe S., it was mentioned that we are keeping around some tables purely for dynamic conformance checking of protocols. But IIUC, the language only permits such checks for protocols that can be existentials, so in theory we should be dead-stripping all the other tables. Someone needs to check whether that's possible.

belkadan commented 7 years ago

Ah, I'd be concerned about doing that in the future. If we ever add such a feature, it will be important that it works with existing compiled code.

dabrahams commented 7 years ago

Jordan, please spell out your concerns. "It might break existing code" is always something we want to watch out for, but you haven't given any specific reasons to think that is more likely to happen here.

belkadan commented 7 years ago

Thanks, sorry. If Swift 8 has binaries shipped with the OS, and then Swift 9 gains the ability to check conformances for protocols that cannot be existentials, then it would be nice™ if user code written with Swift 9 is able to check conformances even when deploying back to an OS that has Swift 8 libraries. (If that's not the case, then we'd need to gate the new conformance-checking feature on the deployment target.)