AliSoftware / Dip

Simple Swift Dependency container. Use protocols to resolve your dependencies and avoid singletons / sharedInstances!
MIT License
978 stars 75 forks source link

Removed extension of ImplicitlyUnwrappedOptional #191

Closed Gruppio closed 6 years ago

Gruppio commented 6 years ago

ImplicitlyUnwrappedOptional was already deprecated and it has been removed in swift 4.2 If you don't remove this extension Dip won't compile with Swift 4.2

ilyapuchka commented 6 years ago

@Gruppio thanks, but this will be merged only when Swift 4.2 is released

beefon commented 6 years ago

Is there a way to compile this conditionally?

beefon commented 6 years ago

https://github.com/apple/swift-evolution/blob/master/proposals/0020-if-swift-version.md

beefon commented 6 years ago

I assume this PR might be updated with

#if swift(<4.2)
extension ImplicitlyUnwrappedOptional: BoxType {        
   var unboxed: Any? {      
     return self ?? nil     
   }        
 }
#endif
Gruppio commented 6 years ago

I've add the check if swift is >= 4.1, so it is removed a warning in the current stable release ( 4.1 )