digitalmars.D - Another Shared Bug?
- Andrew Wiley <wiley.andrew.j gmail.com> Oct 24 2011
- Dmitry Olshansky <dmitry.olsh gmail.com> Oct 24 2011
--20cf303639cf81586504b0130996
Content-Type: text/plain; charset=ISO-8859-1
My understanding is that this:
--------
module test2;
synchronized abstract class Bob {
private:
int _i = 2;
public:
property
int i() {
return _i;
}
}
synchronized class Bill : Bob {
public:
property
int thing() {
return i;
}
}
--------
should be the same as this:
--------
module test2;
synchronized abstract class Bob {
private:
int _i = 2;
public:
property
int i() {
return _i;
}
}
synchronized class Bill : Bob {
public:
property
int thing() {
return super.i(); //test2.d(18): Error: function test2.Bob.i () shared is
not callable using argument types ()
}
}
--------
But the second one gets a compiler error. Bug?
--20cf303639cf81586504b0130996
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
My understanding is that this:<div><div>--------
</div><div>module test2;</div><div><br></div><div>synchronized abstract cla=
ss Bob {</div><div>private:</div><div><span class=3D"Apple-tab-span" style=
=3D"white-space:pre"> </span>int _i =3D 2;</div><div><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre"> </span></div>
<div>public:</div><div><span class=3D"Apple-tab-span" style=3D"white-space:=
pre"> </span> property</div><div><span class=3D"Apple-tab-span" style=3D"wh=
ite-space:pre"> </span>int i() {</div><div><span class=3D"Apple-tab-span" s=
tyle=3D"white-space:pre"> </span>return _i;</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>}</di=
v><div>}</div><div><br></div><div>synchronized class Bill : Bob {</div><div=
public:</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"=
</span> property</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>int t=
hing() {</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"=
</span>return i;</div><div><span class=3D"Apple-tab-span" style=3D"white=
<div>}</div></div><div>--------
</div><div>should be the same as this:</div><div>--------</div><div><div>mo=
dule test2;</div><div><br></div><div>synchronized abstract class Bob {</div=
<div>private:</div><div><span class=3D"Apple-tab-span" style=3D"white-spac=
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span></div=
<div>public:</div><div><span class=3D"Apple-tab-span" style=3D"white-space=
hite-space:pre"> </span>int i() {</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>retu=
rn _i;</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>}</div><div>}</div><div><br></div><div>synchronized class Bill : Bob=
{</div>
<div>public:</div><div><span class=3D"Apple-tab-span" style=3D"white-space:=
pre"> </span> property</div><div><span class=3D"Apple-tab-span" style=3D"wh=
ite-space:pre"> </span>int thing() {</div><div><span class=3D"Apple-tab-spa=
n" style=3D"white-space:pre"> </span>return super.i(); //test2.d(18): Erro=
r: function test2.Bob.i () shared is not callable using argument types ()</=
div>
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>}</di=
v><div>}</div></div><div>--------
</div><div><span style=3D"background-color: transparent; ">But the second o=
ne gets a compiler error. Bug?</span></div>
--20cf303639cf81586504b0130996--
Oct 24 2011
On 25.10.2011 2:34, Andrew Wiley wrote:My understanding is that this: -------- module test2; synchronized abstract class Bob { private: int _i = 2; public: property int i() { return _i; } } synchronized class Bill : Bob { public: property int thing() { return i; } } -------- should be the same as this: -------- module test2; synchronized abstract class Bob { private: int _i = 2; public: property int i() { return _i; } } synchronized class Bill : Bob { public: property int thing() { return super.i(); //test2.d(18): Error: function test2.Bob.i () shared is not callable using argument types ()
Mm maybe it complains about i being property and not a function? Though that was forced yet(?). Does plain super.i without () work here? Sometimes error messages are plain wrong. In ether case it seems like a bug.} } -------- But the second one gets a compiler error. Bug?
-- Dmitry Olshansky
Oct 24 2011








Dmitry Olshansky <dmitry.olsh gmail.com>