Issue with the experimental branch of swift 4 #167

Closed
opened 2025-12-29 18:23:57 +01:00 by adam · 8 comments
Owner

Originally created by @Plnda on GitHub (Sep 13, 2017).

/Users/pindakaasgroot/Development/Pinch/Telegraaf/Pods/CoreStore/Sources/DataStack+Migration.swift:650:25: Ambiguous use of 'withExtendedLifetime'

I get this error trying to compile with the experimental swift 4 branch

Originally created by @Plnda on GitHub (Sep 13, 2017). /Users/pindakaasgroot/Development/Pinch/Telegraaf/Pods/CoreStore/Sources/DataStack+Migration.swift:650:25: Ambiguous use of 'withExtendedLifetime' I get this error trying to compile with the experimental swift 4 branch
adam added the wontfix label 2025-12-29 18:23:57 +01:00
adam closed this issue 2025-12-29 18:23:57 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Sep 14, 2017):

Are you using Cocoapods or Carthage?

@JohnEstropia commented on GitHub (Sep 14, 2017): Are you using Cocoapods or Carthage?
Author
Owner

@brosnic commented on GitHub (Sep 14, 2017):

I have the same Issue. I'm using Cococapods

@brosnic commented on GitHub (Sep 14, 2017): I have the same Issue. I'm using Cococapods
Author
Owner

@Plnda commented on GitHub (Sep 14, 2017):

@JohnEstropia Pods

@Plnda commented on GitHub (Sep 14, 2017): @JohnEstropia Pods
Author
Owner

@JohnEstropia commented on GitHub (Sep 14, 2017):

Ah, this looks like the same problem as https://github.com/JohnEstropia/CoreStore/issues/184
Please make sure that your project is compiling CoreStore as Swift 4, not as Swift 3.2. (The reverse is also true if you're using the Swift3.2 branch)

Because Cocoapods doesn't have a per-pod Swift version setting yet, you can do this yourself from your Podfile:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            if target.name == 'CoreStore'
                config.build_settings['SWIFT_VERSION'] = '4.0'
            end
        end
    end
end

Or if you don't need the new stuff in the Swift4 branch yet, you can just use the Swift 3.2 branch instead. (to match your app's Swift version)

@JohnEstropia commented on GitHub (Sep 14, 2017): Ah, this looks like the same problem as https://github.com/JohnEstropia/CoreStore/issues/184 Please make sure that your project is compiling CoreStore as Swift 4, not as Swift 3.2. (The reverse is also true if you're using the Swift3.2 branch) Because Cocoapods doesn't have a per-pod Swift version setting yet, you can do this yourself from your Podfile: ``` post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| if target.name == 'CoreStore' config.build_settings['SWIFT_VERSION'] = '4.0' end end end end ``` Or if you don't need the new stuff in the Swift4 branch yet, you can just use the Swift 3.2 branch instead. (to match your app's Swift version)
Author
Owner

@JohnEstropia commented on GitHub (Sep 16, 2017):

@Plnda @brosnic Did the SWIFT_VERSION configuration above help you?

@JohnEstropia commented on GitHub (Sep 16, 2017): @Plnda @brosnic Did the SWIFT_VERSION configuration above help you?
Author
Owner

@Plnda commented on GitHub (Sep 18, 2017):

@JohnEstropia I got it working thanks!

@Plnda commented on GitHub (Sep 18, 2017): @JohnEstropia I got it working thanks!
Author
Owner

@JohnEstropia commented on GitHub (Sep 22, 2017):

Glad it's fixed. My recommendation is to use the corresponding Swift branch for your app's swift version:
Swift 3.2: prototype/Swift_3_2
Swift 4.0: prototype/Swift_4_0

@JohnEstropia commented on GitHub (Sep 22, 2017): Glad it's fixed. My recommendation is to use the corresponding Swift branch for your app's swift version: Swift 3.2: `prototype/Swift_3_2` Swift 4.0: `prototype/Swift_4_0`
Author
Owner

@svoip commented on GitHub (Oct 25, 2017):

I have a freshly created app with SWIFT_VERSION = 4.0.
I cannot make any branch of CoreStore compile with it.

I have tried:

  • pod 'CoreStore', '~> 4.0' ... which installs 4.2.0 and it leads Xcode showing broken CoreStore API changes;

  • pod 'CoreStore', :git => 'https://github.com/JohnEstropia/CoreStore.git', :branch => 'prototype/Swift_4_0' .... which installs 5.0.0 and it leads to compiler throwing
    "fatal error encountered while reading from module 'CoreStore'.....DESERIALIZATION FAILURE ".

I tried the "per-pod Swift version setting" snippet suggested above, still no luck.

I am using Xcode 9.1 beta2.

@svoip commented on GitHub (Oct 25, 2017): I have a freshly created app with SWIFT_VERSION = 4.0. I cannot make any branch of CoreStore compile with it. I have tried: - pod 'CoreStore', '~> 4.0' ... which installs 4.2.0 and it leads Xcode showing broken CoreStore API changes; - pod 'CoreStore', :git => 'https://github.com/JohnEstropia/CoreStore.git', :branch => 'prototype/Swift_4_0' .... which installs 5.0.0 and it leads to compiler throwing "fatal error encountered while reading from module 'CoreStore'.....DESERIALIZATION FAILURE ". I tried the "per-pod Swift version setting" snippet suggested above, still no luck. I am using Xcode 9.1 beta2.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore-JohnEstropia#167