Re: [swift-users] Generic inheritance with where clause

2017-08-29 Thread somu subscribe via swift-users
Hi Nikita, See if the below implementation fits your needs: protocol P1 {} protocol P2 : P1 where T : P1 { associatedtype T var input : T { get } } struct S1 : P1 {} struct S2 : P2 { typealias T = S1 var input: T } Regards, Muthu > On 30 Aug 2017, at 1:25

Re: [swift-users] Build toolchain failure for swift-4.0-branch on Mac OSX 10.12.6

2017-08-29 Thread Mishal Shah via swift-users
Adding swift-lldb-dev group. Thanks, Mishal Shah > On Aug 29, 2017, at 4:00 PM, Raj Barik via swift-users > wrote: > > OSx version: 10.12.6 (16G29) > Steps to reproduce the error: > 1) > git clone https://github.com/apple/swift.git > > ./swift/utils/updat

[swift-users] Module verifier error with master branch

2017-08-29 Thread Raj Barik via swift-users
OS: 10.12.6 (16G29) Steps: 1) Checkout swift and build master branch git clone https://github.com/apple/swift.git ./swift/utils/update-checkout --clone 2) Edit swift/utils/build-presets.ini to remove tests [preset: buildbot_osx_package] mixin-preset= mixin_osx_package_base

[swift-users] Build toolchain failure for swift-4.0-branch on Mac OSX 10.12.6

2017-08-29 Thread Raj Barik via swift-users
OSx version: 10.12.6 (16G29) Steps to reproduce the error: 1) git clone https://github.com/apple/swift.git ./swift/utils/update-checkout --clone --scheme swift-4.0-branch 2) Edit build-preset.ini to remove tests and assertions: [preset: mixin_lightweight_assertions] #assertions #no-swift-stdlib-

Re: [swift-users] SwiftPM on Linux Failed

2017-08-29 Thread Ankit Aggarwal via swift-users
Hey, Can you post the steps you followed to install the Swift toolchain? Also, can you post the output of: $ swift build -v Thanks! On Tue, Aug 29, 2017 at 8:14 PM, adelzhang via swift-users < swift-users@swift.org> wrote: > > Hi, everyone. > > Installing swift on linux is not that easy. Follo

Re: [swift-users] Still can't derive from a generic class

2017-08-29 Thread Jon Shier via swift-users
Ah, I see. Making a subclass that inherits from a superclass generic to the subclass doesn’t seem like it should be a thing, but I’m not a type theorist. In any case, this is a bug (unexpected runtime crash and all) and you should file it. Jon > On Aug 29, 2017, at 1:25 PM, Joanna Carter

Re: [swift-users] Still can't derive from a generic class

2017-08-29 Thread Joanna Carter via swift-users
Hi Jon > Le 29 août 2017 à 19:20, Jon Shier a écrit : > > This works fine for me in a playground in the latest Xcode 9 beta: > > class Test { } > > class Base { } > > class Sub: Base { } > > let sub = Sub() That may well work but what I want is to be able to do is simpler than that : class

[swift-users] Generic inheritance with where clause

2017-08-29 Thread Nikita Leonov via swift-users
Hello everyone, I am looking a way to express something similar to the following code in Swift terms: protocol AnyViewModelInput {} protocol AnyViewModel: ViewModelInput where ViewModelInput: AnyViewModelInput { var input: ViewModelInput { get } } Is it possible in current Swift? Will it be p

Re: [swift-users] Still can't derive from a generic class

2017-08-29 Thread Jon Shier via swift-users
This works fine for me in a playground in the latest Xcode 9 beta: class Test { } class Base { } class Sub: Base { } let sub = Sub() Jon > On Aug 29, 2017, at 1:04 PM, Joanna Carter via swift-users > wrote: > > Hi > > I would have hoped by now that it should be possible to do : > > cl

[swift-users] Still can't derive from a generic class

2017-08-29 Thread Joanna Carter via swift-users
Hi I would have hoped by now that it should be possible to do : class BaseObject { } class Test : BaseObject { } All compiles well but, at runtime, when calling let test = Test(), I get a "EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)" error. This is something I have been able to do

[swift-users] Generic inheritance with where clause

2017-08-29 Thread Nikita Leonov via swift-users
Hello everyone, I am looking a way to express something similar to the following code in Swift terms: protocol AnyViewModelInput {} protocol AnyViewModel: ViewModelInput where ViewModelInput: AnyViewModelInput { var input: ViewModelInput { get } } Such construct supposed to avoid code duplica

[swift-users] SwiftPM on Linux Failed

2017-08-29 Thread adelzhang via swift-users
Hi, everyone. Installing swift on linux is not that easy. Following https://swift.org/getting-started/#using-the-package-manager instruction, but `swift build` failed: ``` error: manifest parse error(s): /home/vagrant/hello/Package.swift:4:8: error: no such module 'PackageDescription' i