February 14, 2005
struct A
{
  int[] x;
  int foo() { return 0; }
  A bar()
  {
    A v;
    foreach (inout int f; v.x) f = 0; // (1)
    return v;
  }
  float bug(A p1) { return bar.foo; } // error here
}

void main()
{
}

If no '-inline' specified, code compiles successfully.

When '-inline' specified, compiler outputs (dmd -inline -v test.d):

parse     strlv
semantic  strlv
semantic2 strlv
semantic3 strlv
inline scan strlv
test.d(14): this.bar() is not an lvalue

If I comment line (1) bug disappears.

// DMD 0.113
February 19, 2005
Ilya Zaitseff wrote:

| struct A
| {
|   int[] x;
|   int foo() { return 0; }
|   A bar()
|   {
|     A v;
|     foreach (inout int f; v.x) f = 0; // (1)
|     return v;
|   }
|   float bug(A p1) { return bar.foo; } // error here
| }
|
| void main()
| {
| }
|
| If no '-inline' specified, code compiles successfully.
|
| When '-inline' specified, compiler outputs (dmd -inline -v test.d):
|
| parse     strlv
| semantic  strlv
| semantic2 strlv
| semantic3 strlv
| inline scan strlv
| test.d(14): this.bar() is not an lvalue
|
| If I comment line (1) bug disappears.
|
| // DMD 0.113

Added to DStress as
http://dstress.kuehne.cn/run/inline_04.d
http://dstress.kuehne.cn/run/inline_05.d
http://dstress.kuehne.cn/run/inline_06.d

Thomas