www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 969] New: 'this' needed for class member

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=969

           Summary: 'this' needed for class member
           Product: D
           Version: 1.006
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: maxter i.com.ua


The compiler chokes on the code below with the error: need 'this' to access
member a'. Should it?

template TFoo(alias T)
{
        void foo()
        {
                writefln(T);
        }
}

template TBar(alias T)
{
        void bar()
        {
                TFoo!(T).foo();
        }
}

class Test
{
        int a;
        mixin TBar!(a);
}

void main()
{
}


-- 
Feb 16 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=969


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All





One variation of the issue results in:
template.c:2853: TemplateDeclaration* 
TemplateInstance::findTemplateDeclaration(Scope*): Assertion `s->parent'
failed.

Added to DStress as
http://dstress.kuehne.cn/run/b/bug_template_2851_A.d
http://dstress.kuehne.cn/run/b/bug_template_2851_B.d
http://dstress.kuehne.cn/run/b/bug_template_2851_C.d


-- 
Feb 26 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=969


bugzilla digitalmars.com changed:

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





Works fine with DMD 1.021 / 2.003

P.S. When you say "one variation", please let me know which one. This is
especially helpful when I cannot reproduce the problem.


-- 
Aug 12 2007