Skip to content

Commit

Permalink
Fix regression case, defer string mixin resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed May 13, 2015
1 parent a0791d5 commit 0bbde0b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/attrib.c
Expand Up @@ -1284,11 +1284,12 @@ Dsymbol *CompileDeclaration::syntaxCopy(Dsymbol *s)
int CompileDeclaration::addMember(Scope *sc, ScopeDsymbol *sds, int memnum)
{
//printf("CompileDeclaration::addMember(sc = %p, sds = %p, memnum = %d)\n", sc, sds, memnum);
#if 0
if (compiled)
return 1;

#endif
this->scopesym = sds;

#if 0
if (memnum == 0)
{
/* No members yet, so parse the mixin now
Expand All @@ -1297,6 +1298,7 @@ int CompileDeclaration::addMember(Scope *sc, ScopeDsymbol *sds, int memnum)
memnum |= AttribDeclaration::addMember(sc, sds, memnum);
compiled = 1;
}
#endif
return memnum;
}

Expand Down
19 changes: 19 additions & 0 deletions test/compilable/testfwdref.d
Expand Up @@ -458,3 +458,22 @@ class Frop14549

static if (!__traits(isVirtualMethod, this.bar)) {}
}

// ----

template Mix14549()
{
mixin(code14549!(typeof(this)));
}

template code14549(T)
{
enum string code14549 =
q{ static if (!__traits(isVirtualMethod, "boo")) {} };
}

class Bar14549
{
mixin Mix14549;
int boo;
}

0 comments on commit 0bbde0b

Please sign in to comment.