Skip to content

Commit

Permalink
fix Issue 10158 - 'offsetof' property of nested struct does not work …
Browse files Browse the repository at this point in the history
…properly
  • Loading branch information
9rnsr committed Apr 2, 2015
1 parent 35f0faf commit 78c5bad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/compilable/compile1.d
Expand Up @@ -541,6 +541,28 @@ static if (is(object.ModuleInfo == class))
__traits(classInstanceSize, ModuleInfo));
}

/***************************************************/
// 10158

class Outer10158
{
static struct Inner
{
int f;
}

void test()
{
static assert( Inner.f .offsetof == 0); // OK <- NG
static assert((Inner.f).offsetof == 0); // OK
}
}

void test10158()
{
static assert(Outer10158.Inner.f.offsetof == 0); // OK
}

/***************************************************/
// 10326

Expand Down

0 comments on commit 78c5bad

Please sign in to comment.