@Dave,
How do I write that though.
I can't write:
extension Array: Equatable {
static func ==(lhs: Array, rhs: Array) -> Bool {
let size = lhs.count
precondition(rhs.count == size, "The arrays must be the same
length")
for i in 0 ..< size {
And, as I know, it's not possible to call protocol's implementation in that case
> 16 нояб. 2016 г., в 4:29, Rick Mann via swift-users
> написал(а):
>
> Okay. I coudln't find official documentation on this, and I don't currently
> need to do this, but wanted to fully
And, as I know, it's not possible to call protocol's implementation in that case
> 16 нояб. 2016 г., в 9:09, Игорь Никитин via swift-users
> написал(а):
>
> Right, it’s a recursion, because this
>
> (self as FooPro).fooFunc()
>
> Will call FooClass’s method
Right, it’s a recursion, because this
(self as FooPro).fooFunc()
Will call FooClass’s method implementation
You can read more about dispatch rules here:
https://medium.com/ios-os-x-development/swift-protocol-extension-method-dispatch-6a6bf270ba94#.hkh1rc56p
Hi All,
Does anyone have a good workaround for generics not currently supporting
conditional conformance to a protocol. As stated in the Generics Manifesto
something like this would be nice:
extension Array: Equatable where Element: Equatable {
static func ==(lhs: Array, rhs: Array) ->
Okay. I coudln't find official documentation on this, and I don't currently
need to do this, but wanted to fully understand it.
> On Nov 15, 2016, at 17:27 , zh ao wrote:
>
> 'Default' implementation in protocol extension is used as fail safe. You
> should not consider it
Well, this is a standard protocol default implementation. I was experimenting
to see if it was possible to call the default implementation after providing a
concrete implementation.
> On Nov 15, 2016, at 14:47 , Dan Loewenherz wrote:
>
> What are you trying to accomplish
> On Nov 15, 2016, at 05:24 , Jeremy Pereira
> wrote:
>
>
>> On 15 Nov 2016, at 10:33, Rick Mann wrote:
>>
>> Well, that's not really any different than a switch statement, in that it
>> has to be maintained.
>
> Yes, but I would
> On 15 Nov 2016, at 10:33, Rick Mann wrote:
>
> Well, that's not really any different than a switch statement, in that it has
> to be maintained.
Yes, but I would argue that it is a good thing because you need to do some
validation before you instantiate the class
@David
If you would split up the statement like this...
let x = 0 *** 4
let result = x +++ 0
... the compiler would report an ambiguity error, because both overloads of ***
are valid and of equivalent priority.
You could do something like this though:
let x: Int = 0 *** 4// picks f2
let
10 matches
Mail list logo