www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - inline lvalue bug

reply "Ilya Zaitseff" <sark7 mail333.com> writes:
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
Feb 14 2005
parent =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCFxVj3w+/yD4P9tIRAm2gAKCQJAlmuYXAG/NCXKeHlPB65+4ULACdHmob
6eND/6Ir84LpHXffqAvvgCs=
=8U5x
-----END PGP SIGNATURE-----
Feb 19 2005