digitalmars.D.bugs - [Issue 2367] New: Overloading error
- d-bugmail puremagic.com (23/23) Sep 20 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- Jarrett Billingsley (7/29) Sep 20 2008 "string literals" do not have a type; they are, in some ways,
- Andrei Alexandrescu (4/41) Sep 20 2008 To facilitate archiving, you may want to post replies to the website
- Jarrett Billingsley (5/48) Sep 20 2008 Well that's weird, I could have sworn that replies posted to the NG
- Denis Koroskin (7/58) Sep 20 2008 No, it never used to and I like the way it is!
- Jarrett Billingsley (2/62) Sep 20 2008 Well well. Color me wrong.
- Brad Roberts (2/19) Sep 20 2008 It's supposed to. If that's stopped working, I'll fix it. It's
- Jarrett Billingsley (2/21) Sep 20 2008 I knew it!
- Jarrett Billingsley (3/25) Sep 20 2008 Testing, testing.
- d-bugmail puremagic.com (9/9) Sep 20 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (14/14) Sep 20 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (7/7) Sep 20 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (6/9) Sep 30 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (18/18) Jun 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (6/6) Jun 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (10/10) Jun 15 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (10/10) Jun 17 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (14/14) Jun 29 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (10/10) Sep 10 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (9/9) Oct 09 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (14/14) Feb 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (10/10) Mar 24 2012 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (9/9) Mar 26 2012 http://d.puremagic.com/issues/show_bug.cgi?id=2367
- d-bugmail puremagic.com (9/9) Mar 26 2012 http://d.puremagic.com/issues/show_bug.cgi?id=2367
http://d.puremagic.com/issues/show_bug.cgi?id=2367 Summary: Overloading error Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com The following code does not compile: struct S { void foo(in char[] s) {} void foo(in dchar[] s) {} } void main(string[] args) { S s; s.foo("a"); } The second overload should not even be considered. --
Sep 20 2008
On Sat, Sep 20, 2008 at 2:01 PM, <d-bugmail puremagic.com> wrote:http://d.puremagic.com/issues/show_bug.cgi?id=2367 Summary: Overloading error Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com The following code does not compile: struct S { void foo(in char[] s) {} void foo(in dchar[] s) {} } void main(string[] args) { S s; s.foo("a"); } The second overload should not even be considered."string literals" do not have a type; they are, in some ways, polysemous. They are considered char[], wchar[], or dchar[] based on where they're used. If they're used in a situation where it could go either way (such as this overloading case), it's an error. The solution is simple: affix a 'c', 'w', or 'd' to the end of the string literal to give it an explicit type.
Sep 20 2008
Jarrett Billingsley wrote:On Sat, Sep 20, 2008 at 2:01 PM, <d-bugmail puremagic.com> wrote:To facilitate archiving, you may want to post replies to the website instead. Andreihttp://d.puremagic.com/issues/show_bug.cgi?id=2367 Summary: Overloading error Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com The following code does not compile: struct S { void foo(in char[] s) {} void foo(in dchar[] s) {} } void main(string[] args) { S s; s.foo("a"); } The second overload should not even be considered."string literals" do not have a type; they are, in some ways, polysemous. They are considered char[], wchar[], or dchar[] based on where they're used. If they're used in a situation where it could go either way (such as this overloading case), it's an error. The solution is simple: affix a 'c', 'w', or 'd' to the end of the string literal to give it an explicit type.
Sep 20 2008
On Sat, Sep 20, 2008 at 3:10 PM, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:Jarrett Billingsley wrote:Well that's weird, I could have sworn that replies posted to the NG thread were mirrored on bugzilla. Maybe it's a bug in the puremagic mailing lists?On Sat, Sep 20, 2008 at 2:01 PM, <d-bugmail puremagic.com> wrote:To facilitate archiving, you may want to post replies to the website instead. Andreihttp://d.puremagic.com/issues/show_bug.cgi?id=2367 Summary: Overloading error Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com The following code does not compile: struct S { void foo(in char[] s) {} void foo(in dchar[] s) {} } void main(string[] args) { S s; s.foo("a"); } The second overload should not even be considered."string literals" do not have a type; they are, in some ways, polysemous. They are considered char[], wchar[], or dchar[] based on where they're used. If they're used in a situation where it could go either way (such as this overloading case), it's an error. The solution is simple: affix a 'c', 'w', or 'd' to the end of the string literal to give it an explicit type.
Sep 20 2008
On Sat, 20 Sep 2008 23:55:38 +0400, Jarrett Billingsley <jarrett.billingsley gmail.com> wrote:On Sat, Sep 20, 2008 at 3:10 PM, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:No, it never used to and I like the way it is! Sometimes I express my thoughts on the subject here on purpose so that they don't get posted to the bugzilla (because they address some irrelevant topic or loosely related to the original post or not helpful all). This discussion is on of examples :)Jarrett Billingsley wrote:Well that's weird, I could have sworn that replies posted to the NG thread were mirrored on bugzilla. Maybe it's a bug in the puremagic mailing lists?On Sat, Sep 20, 2008 at 2:01 PM, <d-bugmail puremagic.com> wrote:To facilitate archiving, you may want to post replies to the website instead. Andreihttp://d.puremagic.com/issues/show_bug.cgi?id=2367 Summary: Overloading error Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com The following code does not compile: struct S { void foo(in char[] s) {} void foo(in dchar[] s) {} } void main(string[] args) { S s; s.foo("a"); } The second overload should not even be considered."string literals" do not have a type; they are, in some ways, polysemous. They are considered char[], wchar[], or dchar[] based on where they're used. If they're used in a situation where it could go either way (such as this overloading case), it's an error. The solution is simple: affix a 'c', 'w', or 'd' to the end of the string literal to give it an explicit type.
Sep 20 2008
On Sat, Sep 20, 2008 at 4:35 PM, Denis Koroskin <2korden gmail.com> wrote:On Sat, 20 Sep 2008 23:55:38 +0400, Jarrett Billingsley <jarrett.billingsley gmail.com> wrote:Well well. Color me wrong.On Sat, Sep 20, 2008 at 3:10 PM, Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:No, it never used to and I like the way it is! Sometimes I express my thoughts on the subject here on purpose so that they don't get posted to the bugzilla (because they address some irrelevant topic or loosely related to the original post or not helpful all). This discussion is on of examples :)Jarrett Billingsley wrote:Well that's weird, I could have sworn that replies posted to the NG thread were mirrored on bugzilla. Maybe it's a bug in the puremagic mailing lists?On Sat, Sep 20, 2008 at 2:01 PM, <d-bugmail puremagic.com> wrote:To facilitate archiving, you may want to post replies to the website instead. Andreihttp://d.puremagic.com/issues/show_bug.cgi?id=2367 Summary: Overloading error Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com The following code does not compile: struct S { void foo(in char[] s) {} void foo(in dchar[] s) {} } void main(string[] args) { S s; s.foo("a"); } The second overload should not even be considered."string literals" do not have a type; they are, in some ways, polysemous. They are considered char[], wchar[], or dchar[] based on where they're used. If they're used in a situation where it could go either way (such as this overloading case), it's an error. The solution is simple: affix a 'c', 'w', or 'd' to the end of the string literal to give it an explicit type.
Sep 20 2008
It's supposed to. If that's stopped working, I'll fix it. It's extremely handy.Well well. Color me wrong.No, it never used to and I like the way it is! Sometimes I express my thoughts on the subject here on purpose so that they don't get posted to the bugzilla (because they address some irrelevant topic or loosely related to the original post or not helpful all). This discussion is on of examples :)To facilitate archiving, you may want to post replies to the website instead. AndreiWell that's weird, I could have sworn that replies posted to the NG thread were mirrored on bugzilla. Maybe it's a bug in the puremagic mailing lists?
Sep 20 2008
On Sat, Sep 20, 2008 at 11:00 PM, Brad Roberts <braddr puremagic.com> wrote:I knew it!It's supposed to. If that's stopped working, I'll fix it. It's extremely handy.Well well. Color me wrong.No, it never used to and I like the way it is! Sometimes I express my thoughts on the subject here on purpose so that they don't get posted to the bugzilla (because they address some irrelevant topic or loosely related to the original post or not helpful all). This discussion is on of examples :)To facilitate archiving, you may want to post replies to the website instead. AndreiWell that's weird, I could have sworn that replies posted to the NG thread were mirrored on bugzilla. Maybe it's a bug in the puremagic mailing lists?
Sep 20 2008
<d-bugmail puremagic.com> wrote in message news:bug-2367-3 http.d.puremagic.com/issues/...http://d.puremagic.com/issues/show_bug.cgi?id=2367 Summary: Overloading error Product: D Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: andrei metalanguage.com The following code does not compile: struct S { void foo(in char[] s) {} void foo(in dchar[] s) {} } void main(string[] args) { S s; s.foo("a"); } The second overload should not even be considered.Testing, testing.
Sep 20 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2367 "string literals" do not have a type; they are, in some ways, polysemous. They are considered char[], wchar[], or dchar[] based on where they're used. If they're used in a situation where it could go either way (such as this overloading case), it's an error. The solution is simple: affix a 'c', 'w', or 'd' to the end of the string literal to give it an explicit type. --
Sep 20 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2367 Even with polysemy, vocables may have a principal meaning. For example "1" is polysemous because it fits byte, ubyte etc. but absent any constraint it will prefer to be an int. auto i = 1; // i's type is int As discussed with Walter, strings are also easy to acquire a principal meaning. One possibility discussed is that strings with only ASCII characters to have invariant(char)[N] as principal type. In fact the N should be dropped too for a number of reasons. So "a" should have principal type invariant(char)[]. (If a constraint is present, no problem.) The exaggerated ambiguity of string literals has caused much grief to many people, it's about time to fix it. --
Sep 20 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2367 Amen to dropping the fixed-sizedness of string literals. I suppose determining the type based on the smallest type that can represent the data without using multibyte encodings is reasonable enough, and you're right, it fits in with the way it works for ints. --
Sep 20 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2367One possibility discussed is that strings with only ASCII characters to have invariant(char)[N] as principal type.What's up with ASCII? char in D is utf byte.In fact the N should be dropped too for a number of reasons.ololo templates? --
Sep 30 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2367 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yebblies gmail.com From Andrei's comment on bug 2606 void f(const(char)[] s) {} void f(const(dchar)[] s) {} void main() { f("abc"); auto a = "abc"; f(a); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2367 *** Issue 2606 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2367 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dfj1esp02 sneakemail.com *** Issue 4592 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 15 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2367 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ellery-newcomer utulsa.edu *** Issue 4353 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 17 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2367 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch Platform|x86 |All Version|unspecified |D2 OS/Version|Linux |All https://github.com/D-Programming-Language/dmd/pull/176 This issue also applies to 'null' literals. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 29 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2367 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zeljko.grk gmail.com *** Issue 6639 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 10 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2367 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla digitalmars.com Severity|normal |enhancement -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 09 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2367 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|pull | AssignedTo|nobody puremagic.com |bugzilla digitalmars.com The pull is still valid (if in need of a rebase) but the solution needs a decision from Walter on how the match level problem is going to be solved in the future. See issue 4953 for another example. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 19 2012
http://d.puremagic.com/issues/show_bug.cgi?id=2367 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull --- https://github.com/D-Programming-Language/dmd/pull/834 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 24 2012
http://d.puremagic.com/issues/show_bug.cgi?id=2367 Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/58f284e625cb6591f476c1fbcad38a6dc66ca039 Issue 2367 - Overloading error with string literals -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 26 2012
http://d.puremagic.com/issues/show_bug.cgi?id=2367 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 26 2012