Re: [swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-04 Thread Rien via swift-users
As you know. there is no ambiguity, no warnings needed. (The parameter is part of the identifier of the function) Imo, this request falls into the category “do as I think, not as I say”. That is a discussion without end. Personally I am against ANY warnings of this kind. The reason is that I

Re: [swift-users] question about swift and c callbacks

2017-01-04 Thread Yang Yang via swift-users
Thanks. It compiled successfully now under linux. 2017-01-04 12:29 GMT-06:00 Joe Groff : > > > On Dec 30, 2016, at 11:17 AM, Yang Yang via swift-users < > swift-users@swift.org> wrote: > > > > I try to wrap a c library in swift package named Test. > > The code looks like this:

Re: [swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-04 Thread Saagar Jha via swift-users
Ahh, I get what you’re saying now. In this case I’d like to see a warning when a “conflicting” function is defined that there may be potential ambiguity. Saagar Jha > On Jan 4, 2017, at 8:19 PM, Wagner Truppel wrote: > > Indeed, and in this case as well the compiler issues

Re: [swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-04 Thread Wagner Truppel via swift-users
Indeed, and in this case as well the compiler issues no warning even though the ambiguity is evident. I had to try it on a playground to be sure that it’s the parameter-less foo() rather than the default-argumented foo(x:) that gets invoked when we call foo() on an instance. Of course, both

Re: [swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-04 Thread Jacob Bandes-Storch via swift-users
The same ambiguity occurs even without inheritance: class C { func foo() {} func foo(x: Int = 0) {} } Somewhat related: https://bugs.swift.org/browse/SR-1408 On Wed, Jan 4, 2017 at 7:42 PM, Wagner Truppel via swift-users < swift-users@swift.org> wrote: > I’m afraid I wasn’t clear

Re: [swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-04 Thread Saagar Jha via swift-users
I’m not quite sure what you mean by "restrictions of parent implementations”, however, the “default value” you’re mentioning is a fundamental part of OOP–when a subclass overrides a superclass, it gets the parent class’s methods for free. There’s no need to issue a warning for this, since it’s

[swift-users] Compiler should issue a warning when a subclass implementation with default values matches a parent implementation without them

2017-01-04 Thread Wagner Truppel via swift-users
Hello, I wasn’t sure whether to post this message here, at swift-dev, or at swift-evolution. so I’ll try here first. Hopefully it will get to the right group of people or, if not, someone will point me to the right mailing list. I came across a situation that boils down to this example: class

Re: [swift-users] How much memory does withMemoryRebound bind

2017-01-04 Thread Andrew Trick via swift-users
> On Dec 29, 2016, at 2:03 PM, Guillaume Lessard via swift-users > wrote: > > Hi Etan, > > `withMemoryRebound` does not copy memory. > The proposal for UnsafeRawPointer contains information about the memory model > (as related to pointers): >

Re: [swift-users] Zero cost abstraction 2D Iterator (equivalent to two nested for loops) impossible?

2017-01-04 Thread Jens Persson via swift-users
Thanks, I wonder if it is currently impossible to make it as fast as the nested for loops, ie that some optimizer improvement could fix it. Here's a stripped down version of my code: import QuartzCore // This is just for timing using CACurrentMediaTime() struct Point2DInt { var x: Int