Re: [swift-users] dynamic requires @objc in Framework, but not in monolithic project

2017-09-13 Thread Rick Mann via swift-users
Very helpful, thank you. -- Rick Mann rm...@latencyzero.com > On Sep 13, 2017, at 21:24, Hooman Mehr wrote: > > Documentation is behind the actual state. > > What you see is the result of this change: SE-0160 Limiting @objc inference > >> On Sep 13, 2017, at 5:18 PM, Roderick Mann wrote: >

Re: [swift-users] dynamic requires @objc in Framework, but not in monolithic project

2017-09-13 Thread Hooman Mehr via swift-users
Documentation is behind the actual state. What you see is the result of this change: SE-0160 Limiting @objc inference > On Sep 13, 2017, at 5:18 PM, Roderick Mann wrote: > > Ah. That's the difference. Okay.

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-13 Thread somu subscribe via swift-users
Not sure why it is happening, but given below are my observations: Simplified version: var array = [1, 2, 3, 4, 5] _ = array.popFirst() //error: cannot use mutating member on immutable value: 'array' is immutable _ = array.popLast() //works ok popFirst is not available in the Array documentatio

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-13 Thread Jon Shier via swift-users
I think there’s something strange with popFirst. It doesn’t show up in the autocomplete in Xcode, but it compiles, and popLast doesn’t throw the same error. removeFirst doesn’t either, though it’s unsafe. Weird. Jon > On Sep 13, 2017, at 9:47 PM, Zhao Xin via swift-users > wrote: >

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-13 Thread Zhao Xin via swift-users
I begin to think it is related to how you `popFirst()` implemented. Check it or post it here. Zhao Xin On Thu, Sep 14, 2017 at 9:36 AM, Roderick Mann wrote: > Yeah, that's not it. I made the change you suggested, I get the same error. > > > On Sep 13, 2017, at 18:11 , Zhao Xin wrote: > > > > C

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-13 Thread Roderick Mann via swift-users
Yeah, that's not it. I made the change you suggested, I get the same error. > On Sep 13, 2017, at 18:11 , Zhao Xin wrote: > > Change `self` to `ModelFetcher`. You are calling a class static property, not > a class instance property. > > Zhao Xin > > On Thu, Sep 14, 2017 at 8:37 AM, Rick Mann

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-13 Thread Roderick Mann via swift-users
Did this change in Swift 4? I like being able to refer to the class in a class func as "self". If I ever change the name of the class, or refactor the code, or something, I don't have to change it in a bunch of places. > On Sep 13, 2017, at 18:11 , Zhao Xin wrote: > > Change `self` to `ModelF

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-13 Thread Roderick Mann via swift-users
Also, it works fine at a couple of other call sites. Why is this one special? > On Sep 13, 2017, at 18:11 , Zhao Xin wrote: > > Change `self` to `ModelFetcher`. You are calling a class static property, not > a class instance property. > > Zhao Xin > > On Thu, Sep 14, 2017 at 8:37 AM, Rick Man

Re: [swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-13 Thread Zhao Xin via swift-users
Change `self` to `ModelFetcher`. You are calling a class static property, not a class instance property. Zhao Xin On Thu, Sep 14, 2017 at 8:37 AM, Rick Mann via swift-users < swift-users@swift.org> wrote: > Moving to Swift 4, I'm running into an issue for which I can't seem to > find an answer i

[swift-users] Swift 4 "Cannot use mutating member on immutable value: 'self' is immutable"

2017-09-13 Thread Rick Mann via swift-users
Moving to Swift 4, I'm running into an issue for which I can't seem to find an answer in google: "Cannot use mutating member on immutable value: 'self' is immutable" The code looks like: class ModelFetcher : NSObject, URLSessionDelegate { ... static let managerDispatchQueue

Re: [swift-users] dynamic requires @objc in Framework, but not in monolithic project

2017-09-13 Thread Roderick Mann via swift-users
Ah. That's the difference. Okay. Nevertheless, the Apple docs on the matter are unclear at best (https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html): "Declarations marked with the dynamic modifier must also be explicit

Re: [swift-users] dynamic requires @objc in Framework, but not in monolithic project

2017-09-13 Thread Hooman Mehr via swift-users
When you create a new project in Xcode 9, the defaults for compiler settings are different. The errors you see are the result of running in full (strict) Swift 4.0 mode which has some such breaking changes. > On Sep 13, 2017, at 3:56 PM, Rick Mann via swift-users > wrote: > > I have an iOS ap

[swift-users] dynamic requires @objc in Framework, but not in monolithic project

2017-09-13 Thread Rick Mann via swift-users
I have an iOS app in which I'm factoring out code into a Framework. In Xcode 9 GM (Swift 4), the code builds fine when it's a monolithic app, but some of the files I've pulled into the framework are no longer compiling. One of the errors is: Model.swift:471:14: 'dynamic' var 'dateCreated' must

Re: [swift-users] noob question about modules

2017-09-13 Thread Alex Blewitt via swift-users
No, submodules in Swift bear little relation to sub packages in Java. It's really just a way of partitioning the namespace within a single module. Nor is there any relation between the path and the name of the module either. Alex > On 12 Sep 2017, at 22:41, blaster_in_black via swift-users >