> On Apr 21, 2016, at 5:50 PM, Charles Lane via swift-users
> wrote:
>
> Xcode wants to insert a comma between the words ‘with rect:’ for some reason.
Is that a two-word parameter “name”, or is it just a parameter with an external
name “with” and an internal name “rect”?
Neil Faiman
> On Apr 21, 2016, at 6:42 PM, Erica Sadun wrote:
>
>
>> On Apr 21, 2016, at 4:37 PM, Neil Faiman via swift-users
>> wrote:
>>
>>
>>> On Apr 21, 2016, at 5:50 PM, Charles Lane via swift-users
>>> wrote:
>>>
>>>
This function seems simple enough:
func foo(a: [Int], n: Int) {
var x : [Int] = a[0..'
var x : [Int] = a[0..) -> ArraySlice { get set }
^
Swift.MutableCollectionType:3:12: note: found this candidate
public subscript (bounds: Range) -> MutableSlice { get
set }
^
Is it possible for a generic class to have methods (specifically, initializers)
which are only defined if the generic parameters meet certain constratins?
Here’s a concrete example:
class Foo {
init(pairs: [(T1, T2)]) {}
// What I’d like to be able to doL
convenience
ay 15, 2016, at 1:33 PM, Karl wrote:
>
> Yes. You need to put it in an extension.
>
> extension Foo where T1 == T2 {
>convenience init(values: [T1]){
>….
> }
> }
>
>> On 15 May 2016, at 14:45, Neil Faiman via swift-users
>> wrote:
>>
This compiles fine:
class Sup {
init(supDes: Int) {}
convenience init(supCon: Int) { self.init(supDes: supCon) }
}
class Sub : Sup {
convenience init(subCon1: Int) { self.init(supDes: subCon1) }
convenience init(subCon2: Int) { self.init(supCon: subCon2
Here is another, more blatant example of the failure to inherit initializers
from a generic base class:
class Concrete {
init(value: Int) {}
}
class ConcreteSub : Concrete {
}
class Generic {
init(value: T) {}
}
class GenericSub : Generic {
}
Using the default Swift with Xcode 7.3.1.
It appears that you cannot use the implicit memberwise initializer with a
struct that has “let” properties with default values.
This works perfectly:
struct CF {
let prop: Int
}
let cf = CF(prop: 1)
But give the property a default v
> On May 17, 2016, at 7:03 AM, Jeremy Pereira
> wrote:
>
>
>> On 16 May 2016, at 22:37, Neil Faiman via swift-users
>> wrote:
>>
>> Using the default Swift with Xcode 7.3.1.
>>
>> It appears that you cannot use the implicit memberwise initial
Swift 2.2 in Xcode 7.3.1.
Apparently you cannot use a named tuple constant as an expression pattern in a
case label.
func test(x: Int, y: Int) -> Int {
let int_1 = 1
switch x {
case 0:
return 0
case int_1:
return 1
default:
break
}
let int_1_1
> On Jun 29, 2016, at 11:03 PM, boris via swift-users
> wrote:
>
> //Report Error: Ambiguous reference to member ‘map’
> //
> numbers.map({
> (number: Int) in
> var ret = 3 * number
> return ret
> })
I asked the same question a few months ago; the answer was that it is
(Resending — this didn’t get any responses when I sent it a month ago.)
Swift 2.2 in Xcode 7.3.1.
Apparently you cannot use a named tuple constant as an expression pattern in a
case label.
func test(x: Int, y: Int) -> Int {
let int_1 = 1
switch x {
case 0:
return 0
case int_1
SR-1993.
> On Jul 5, 2016, at 4:15 PM, Jordan Rose wrote:
>
> I'd definitely consider that a bug. Can you file it at bugs.swift.org?
>
> Jordan
>
>> On Jul 4, 2016, at 14:56, Neil Faiman via swift-users
>> wrote:
>>
>> (Resending — this didn
The language reference says that “Assignment is performed from each part of the
value to the corresponding part of the expression. A String value can be
assigned to a String, and a () -> Int value can be assigned to a () throws ->
Int, so one would reasonably expect that both tuple assignments w
be conflating a tuple-type with tuple-pattern…
>
> Shane
>
>
>> On Jul 5, 2016, at 6:16 PM, Neil Faiman via swift-users
>> wrote:
>>
>> SR-1993.
>>
>>> On Jul 5, 2016, at 4:15 PM, Jordan Rose wrote:
>>>
>>> I'd defini
> On Mar 26, 2016, at 5:47 PM, Maury Markowitz via swift-users
> wrote:
>
> Before I stick my head into the other list, consider:
>
> if statusCode >= 200 && statusCode <= 299
>
> I'm sure examples of something like this occur throughout your code. But the
> actual semantics of the test is
16 matches
Mail list logo