Thread overview
[Issue 379] New: wrong thisptr type in typedef'ed struct
Sep 27, 2006
d-bugmail
Sep 29, 2006
Thomas Kuehne
Nov 23, 2006
Thomas Kuehne
Nov 25, 2006
d-bugmail
September 27, 2006
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@digitalmars.com
        ReportedBy: h3r3tic@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


-- 

September 29, 2006
d-bugmail@puremagic.com schrieb am 2006-09-27:
> http://d.puremagic.com/issues/show_bug.cgi?id=379

> struct Foo {
>         void foo() {
>         }
> }
>
> typedef Foo Bar;
>
>
> void main() {
>         Bar a;
>         a.foo();
> }
>
>> this for foo needs to be type Foo not type Bar

test case:
http://dstress.kuehne.cn/run/t/typedef_07_B.d

Thomas


October 26, 2006
d-bugmail@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@digitalmars.com
>         ReportedBy: h3r3tic@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
November 23, 2006
Tomas Lindquist Olsen schrieb am 2006-10-26:
> d-bugmail@puremagic.com wrote:
>> http://d.puremagic.com/issues/show_bug.cgi?id=379

> Same for classes:
<snip>

test case:
http://dstress.kuehne.cn/run/t/typedef_19_C.d

Thomas


November 25, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=379


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from bugzilla@digitalmars.com  2006-11-25 03:51 -------
Fixed DMD 0.175


--