[swift-users] Generics with Protocols - Separate files

2017-09-16 Thread somu subscribe via swift-users
Hi, When using Generics with Protocols I get a compilation error depending on whether or not conformance to a protocol is defined in the same file or not. Error: Type 'Car.ItemID' (aka 'CarID') does not conform to protocol 'P2' I have 2 swift files: - CarID.swift - CreateCars.swift Observatio

Re: [swift-users] Can't implement generic subscript in protocol

2017-09-16 Thread Joanna Carter via swift-users
Hi Slava > You could also write an explicit closure that loads the subscript: > > let fn = { base[$0] } Thank you so much ! This indeed is the answer and is absolutely logical, I just couldn't see it. Joanna -- Joanna Carter Carter Consulting ___ s