Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
April 20, 2007 [Issue 1168] New: Passing a .stringof of an expression as a template value parameter results in the string of the type | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=1168 Summary: Passing a .stringof of an expression as a template value parameter results in the string of the type Product: D Version: 1.012 Platform: PC OS/Version: Windows Status: NEW Keywords: wrong-code Severity: normal Priority: P3 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: deewiant@gmail.com (Set version as 1.012, since 1.013 wasn't in the list yet.) template T(char[] s) { const char[] T = s; } char[] f(char[] s) { return s; } void main() { int foo; assert (foo.stringof == f(foo.stringof)); // works assert (foo.stringof == T!(foo.stringof)); // fails } T!(foo.stringof) results in "int", it should be "foo". -- |
September 01, 2007 [Issue 1168] Passing a .stringof of an expression as a template value parameter results in the string of the type | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1168 deewiant@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |reiner.pope@gmail.com ------- Comment #1 from deewiant@gmail.com 2007-09-01 03:49 ------- *** Bug 1465 has been marked as a duplicate of this bug. *** -- |
September 05, 2009 [Issue 1168] Passing a .stringof of an expression as a template value parameter results in the string of the type | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1168 Jeremie Pelletier <jeremiep@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremiep@gmail.com --- Comment #2 from Jeremie Pelletier <jeremiep@gmail.com> 2009-09-05 13:47:22 PDT --- The following patch to mtype.c fix the issue: --- ..\src\orig\mtype.cpp Thu Sep 03 01:01:40 2009 +++ ..\src\dmd\mtype.cpp Sat Sep 05 16:42:50 2009 @@ -4530,6 +4530,11 @@ goto Lerror; goto L3; } + else if(v && id == Id::stringof) { + e = new DsymbolExp(loc, s, 0); + *pe = new DotIdExp(loc, e, id); + return; + } t = s->getType(); if (!t && s->isDeclaration()) t = s->isDeclaration()->type; It turns out stringof was applied on the type of the Dsymbol, not the symbol itself. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 07, 2009 [Issue 1168] Passing a .stringof of an expression as a template value parameter results in the string of the type | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1168 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch CC| |clugdbug@yahoo.com.au --- Comment #3 from Don <clugdbug@yahoo.com.au> 2009-09-07 00:37:21 PDT --- Cool! Add 'patch' to the list of keywords when you've submitted a patch, it makes them easier to track. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 06, 2009 [Issue 1168] Passing a .stringof of an expression as a template value parameter results in the string of the type | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=1168 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #4 from Walter Bright <bugzilla@digitalmars.com> 2009-10-06 02:12:29 PDT --- Fixed dmd 1.048 and 2.033 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation