D-Programming-Language/dmd — pull request #2897 by 9rnsr (2013-11-29 03:42:47+00:00)
Title: [REG2.064] Issue 11614 - Error: this for _expand_field_0 needs to be type Tuple not type Foo

https://d.puremagic.com/issues/show_bug.cgi?id=11614

Even if a variable has no valid context, it would be either:

1. a part of compile time evaluated expression, which is used as unreal context.
enum x = Type.fieldvar.sizeof;
// It's legitimate expression so fieldvar is not evaluated
// in runtime.

2. or an invalid field access without valid 'this', in runtime evaluated expression.
int y = Type.fieldvar;
// It's invalid expression so fieldvar access has no valid 'this'.

For the case #2, it will be an error by `checkRightThis` later. Therefore `getRightThis` should not make it an error.