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

2017-01-23 Thread Wagner Truppel via swift-users
Issued created: https://bugs.swift.org/browse/SR-3700 > On 23 Jan 2017, at 10:24, Quinn The Eskimo! via swift-users > wrote: > >> what’s the best way to get this request to the people who can make it happen > > File a Swift bug report. > > > > Please post your bug

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

2017-01-23 Thread Alex Blewitt via swift-users
The right first step is to raise a bug on JIRA https://bugs.swift.org with the example test case in the mail. It will then be assigned to the appropriate individuals and prioritised/fixed accordingly. Alex > On 23 Jan 2017, at 10:04, Wagner Truppel via swift-users >

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

2017-01-23 Thread Zhao Xin via swift-users
I doubt if you could have done that in swift-evolution list. As for an evolution, it requests that you not only provides the question, but also must provide the answer and how to implementing in code together. Zhaoxin On Mon, Jan 23, 2017 at 6:04 PM, Wagner Truppel via swift-users < swift-users@s

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

2017-01-23 Thread Wagner Truppel via swift-users
Ah, excellent! Thanks! Will do shortly. > On 23 Jan 2017, at 10:24, Quinn The Eskimo! via swift-users > wrote: > >> what’s the best way to get this request to the people who can make it happen > > File a Swift bug report. > > > > Please post your bug number, just fo

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

2017-01-23 Thread Quinn "The Eskimo!" via swift-users
On 23 Jan 2017, at 10:04, Wagner Truppel via swift-users wrote: > what’s the best way to get this request to the people who can make it happen File a Swift bug report. Please post your bug number, just for the record. Share and Enjoy -- Quinn "The Eskimo!"

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

2017-01-23 Thread Wagner Truppel via swift-users
Right, so several people have agreed with me that a compiler warning is in order. My question now is: what’s the best way to get this request to the people who can make it happen? swift-dev list? swift-evolution list? Apple radar? Suggestions are welcome. Thanks. Wagner > On 9 Jan 2017, at 09

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

2017-01-09 Thread David Hart via swift-users
I think we need a warning because it is definitely ambiguous and a common pitfall for users of an API. The only solution would be for the APIs be written so to avoid those ambiguities I think. > On 5 Jan 2017, at 08:58, Rien via swift-users wrote: > > As you know. there is no ambiguity, no war

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

2017-01-05 Thread Kenny Leung via swift-users
Hi All. I think this is a case of ambiguity that the compiler is not catching at the call site. Consider this example: private class DefaultValues { // If this method exists, it compiles and it called. // If this method does not exist, the code in the test says, "Ambiguous use of '

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

2017-01-05 Thread Wagner Truppel via swift-users
Exactly. I would only add that renaming might not be the correct solution in some cases as, then, instances of the subclass would still be able to invoke the superclass method and that might not always be acceptable. Wagner > On 5 Jan 2017, at 11:09, Frank O'Dwyer wrote: > > I think there i

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

2017-01-05 Thread Frank O'Dwyer via swift-users
I think there is a clear case for a warning here, in that the introduction of a default parameter value in such cases is in effect an empty promise and just introduces unreachable code. Indeed 'unreachable code' should perhaps be the warning. This is because as soon as there is a foo() method,

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 wan

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 no warning even th

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 thi

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 enoug

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
I’m afraid I wasn’t clear enough on my post. The default value I referred to is the “= 0”. Had it been absent, the call c.foo() would undeniably be fulfilled by the parent class. However, with the default argument value, it’s not obvious whether c.foo() should be the parent’s implementation or t

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 e

[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