www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5718] New: Can't demangle symbol defined inside unittest block

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5718

           Summary: Can't demangle symbol defined inside unittest block
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: cbkbbejeap mailinator.com



20:11:36 PST ---
This worked on 2.050, but fails on 2.052:

---------------------
// demangleUnittestIdent.d
import std.stdio, std.traits, std.demangle;
unittest
{
    int foo;
    writeln( demangle( mangledName!foo ) );
}
void main(){}
---------------------

dmd demangleUnittestIdent.d -unittest
2.050 result: void demangleUnittestIdent.__unittest1() . int foo 2.052 result: nt11__unittest1FZv59__T5DummyS46_D21demangleUnittestIdent11__unittest1FZv3fooi -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 07 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5718


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



01:55:27 PST ---
This appears to be a problem with std.traits.mangledName, as:

  import std.stdio, std.traits, std.demangle;

  unittest
  {
    int foo;
    writeln( foo.mangleof );
    writeln( mangledName!foo );
  }
  void main(){}

prints:

  _D3foo11__unittest1FZv3fooi
  0__T5DummyS27_D3foo11__unittest1FZv3fooi

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 31 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5718




std.traits.mangledName is a workaround for old dmd bugs.
Now built-in mangleof property almost works correctly, so deprecating it is
better.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 31 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5718




15:47:41 PST ---
Ok, can you do a pull request for deprecating it, and then we can close this?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 31 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5718


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull




 Ok, can you do a pull request for deprecating it, and then we can close this?
Sorry, I had mistaken. std.traits.mangledName has an extra feature against the built-in mangleof property. It returns a pseudo mangled name from given template symbol. // from unittest assert(mangledName!mangledName == "3std6traits11mangledName"); It is useful for getting unique string from template symbol, even if std.demangle.demangle() cannot demangle it. Therefore, now I cannot recommend to deprecate it. But we can fix the original issue. Please merge following pull: https://github.com/D-Programming-Language/phobos/pull/414 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5718


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



14:26:53 PST ---
That pull fixes it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 01 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5718




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/686f53f6d2d373ad13ea854b52e924fd7030422f
Issue 5718 - Can't demangle symbol defined inside unittest block

std.traits.mangledName should return valid mangled name against symbols in
function.

https://github.com/D-Programming-Language/phobos/commit/ac88792ea1a15a4815679359b69e731868db4391


Issue 5718 - Can't demangle symbol defined inside unittest block

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 01 2012