Swift 3.1 source compatibility regression

Originator:jp
Number:rdar://30228957 Date Originated:26-Jan-2017 09:11 PM
Status:Open Resolved:
Product:Xcode Product Version:8.3 beta 1 (8W109m)
Classification:Other Bug Reproducible:Always
 
Summary:
As of Xcode 8.3 beta 1 (8W109m), Realm Swift no longer compiles.

This is a regression as Swift 3.1 aims to maintain source compatibility with Swift 3.0.x, and the framework compiles successfully with Swift 3.0.0, 3.0.1 and 3.0.2.

Steps to Reproduce:
1. git clone https://github.com/realm/realm-cocoa.git
2. cd realm-cocoa
3. git submodule update --init --recursive
4. git checkout a0c5399
5. open -a Xcode-8.3.app .
6. Select the "Realm Swift" scheme with "My Mac" as a build target
7. CMD-B to build

Expected Results:
RealmSwift.framework should compile successfully as it does with Xcode 8.0, 8.1 and 8.2.

Actual Results:
RealmSwift.framework fails to compile with the following errors:


/Users/jp/Projects/realm-cocoa/RealmSwift/List.swift:470:1: Type 'List<T>' does not conform to protocol '_IndexableBase'
/Users/jp/Projects/realm-cocoa/RealmSwift/List.swift:470:1: Type 'List<T>' does not conform to protocol 'RangeReplaceableCollection'
/Users/jp/Projects/realm-cocoa/RealmSwift/List.swift:470:1: Type 'List<T>' does not conform to protocol 'RandomAccessCollection'
/Users/jp/Projects/realm-cocoa/RealmSwift/List.swift:470:1: Type 'List<T>' does not conform to protocol '_RangeReplaceableIndexable'
/Users/jp/Projects/realm-cocoa/RealmSwift/List.swift:470:1: Type 'List<T>' does not conform to protocol 'Collection'
/Users/jp/Projects/realm-cocoa/RealmSwift/List.swift:470:1: Type 'List<T>' does not conform to protocol 'BidirectionalCollection'
/Users/jp/Projects/realm-cocoa/RealmSwift/List.swift:470:1: Type 'List<T>' does not conform to protocol '_BidirectionalIndexable'

Version:
Xcode 8.3 beta 1 (8W109m)

Notes:
I also tested this with top-of-trunk Swift from source (b03dfab3b45e79711217273824939c88f997a11c) which includes a fix that Joe Groff (hi Joe!) thought might have helped, but to no avail :(

See this twitter thread for not much more context: https://twitter.com/simjp/status/824685458206515200

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!