[Issue 379] New: wrong thisptr type in typedef'ed struct
Tomas Lindquist Olsen
tomas at famolsen.dk
Thu Oct 26 14:29:46 PDT 2006
d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=379
>
> Summary: wrong thisptr type in typedef'ed struct
> Product: D
> Version: 0.167
> Platform: PC
> OS/Version: Windows
> Status: NEW
> Keywords: rejects-valid
> Severity: normal
> Priority: P2
> Component: DMD
> AssignedTo: bugzilla at digitalmars.com
> ReportedBy: h3r3tic at mat.uni.torun.pl
>
>
> struct Foo {
> void foo() {
> }
> }
>
> typedef Foo Bar;
>
>
> void main() {
> Bar a;
> a.foo();
> }
>
>
>
>> this for foo needs to be type Foo not type Bar
>
>
Same for classes:
---------
import std.stdio : writefln;
class Foo
{
int xxx;
}
typedef Foo Bar;
void main()
{
auto b = new Bar;
writefln("%d", b.xxx);
}
-----------
this for xxx needs to be type Foo not type Bar
More information about the Digitalmars-d-bugs
mailing list