Skip to content

Commit

Permalink
Merge pull request #5001 from 9rnsr/fix14948
Browse files Browse the repository at this point in the history
[REG2.068] Issue 14948 - AA key requirement was broken w/o notice and w/ horrible error message
  • Loading branch information
MartinNowak committed Sep 2, 2015
2 parents 38d31b0 + 5c1d3c5 commit 880f45d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/clone.c
Expand Up @@ -697,6 +697,8 @@ bool needToHash(StructDeclaration *sd)
TypeStruct *ts = (TypeStruct *)tv;
if (needToHash(ts->sym))
goto Lneed;
if (ts->sym->aliasthis) // Bugzilla 14948
goto Lneed;
}
}
Ldontneed:
Expand Down
30 changes: 30 additions & 0 deletions test/runnable/aliasthis.d
Expand Up @@ -1833,6 +1833,36 @@ void test14806()
// ==> c.bar != d.bar || c.baz.get() != d.baz.get()
}

/***************************************************/
// 14948

struct RefCounted14948(T)
{
struct Impl
{
T data;
}
Impl* impl;

@property ref T payload() { return impl.data; }

alias payload this;
}

struct HTTP14948
{
struct Impl
{
}

RefCounted14948!Impl p;
}

void test14948()
{
int[HTTP14948] aa;
}

/***************************************************/

int main()
Expand Down

0 comments on commit 880f45d

Please sign in to comment.