Skip to content

Commit

Permalink
Merge pull request #2585 from rainers/issue10993
Browse files Browse the repository at this point in the history
fix Issue 10993: mangling of voldemort types with lambdas changes during return type inference
  • Loading branch information
9rnsr committed Sep 23, 2013
2 parents 26ca8f7 + e93abe0 commit be57510
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ const char *TemplateInstance::mangle(bool isv)
Dsymbol *par = enclosing || isTemplateMixin() ? parent : tempdecl->parent;
if (par)
{
const char *p = par->mangle();
const char *p = par->mangle(isv);
if (p[0] == '_' && p[1] == 'D')
p += 2;
buf.writestring(p);
Expand Down
33 changes: 33 additions & 0 deletions test/compilable/test10993.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module test10993;

auto foo(T)(T a)
{
static immutable typeof(a) q;
// pragma(msg, "foo: " ~ typeof(q).mangleof);
return q;
}

struct test(alias fn)
{
bool ini = true;
void* p;
}

auto fun()
{
auto x = foo!()(test!(a=>a)());
// pragma(msg, "fun: " ~ typeof(x).mangleof);

return x;
}

void main()
{
const x = fun();
enum mangle_x = typeof(x).mangleof;
// pragma(msg, "x : " ~ mangle_x);
auto y = cast()x;
enum mangle_y = typeof(y).mangleof;
// pragma(msg, "y : " ~ mangle_y);
static assert (mangle_y == mangle_x[1..$]);
}

0 comments on commit be57510

Please sign in to comment.