Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/mtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -8615,6 +8615,16 @@ Expression *TypeClass::dotExp(Scope *sc, Expression *e, Identifier *ident)
return e;
}

#if 1 // Workaround for Bugzilla 9213
FuncDeclaration *fd = sc->func;
if (d->needThis() && d->isVarDeclaration() && fd && fd->vthis)
{
e = new DotVarExp(e->loc, new ThisExp(e->loc), d);
e = e->semantic(sc);
return e;
}
#endif

FuncDeclaration *fdthis = hasThis(sc);
if (d->needThis() && fdthis)
{
Expand Down
11 changes: 8 additions & 3 deletions test/runnable/traits.d
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,17 @@ alias T6073!(__traits(parent, S6073)) U6073; // error
static assert(__traits(isSame, V6073, U6073)); // same instantiation == same arguemnts

/********************************************************/
// 7027

struct Foo7027 {
int a;
}
struct Foo7027 { int a; }
static assert(!__traits(compiles, { return Foo7027.a; }));

/********************************************************/
// 9213

class Foo9213 { int a; }
static assert(!__traits(compiles, { return Foo9213.a; }));

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

interface AA
Expand Down