D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3623 - Cannot mixin templated classes with inner classes
Summary: Cannot mixin templated classes with inner classes
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2009-12-16 20:45 UTC by mike.linford.reg
Modified: 2015-05-19 00:29 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mike.linford.reg 2009-12-16 20:45:19 UTC
The following does not compile (with -version=broken):

class A(T)
{
     version(broken)
     {
         class B
         {
             T blah() { return t; }
         }
     }

     T t;
}

mixin A!(int);

int main()
{
     A!(int) a = new A!(int)();
     return 0;
}

and gives the errors:

Error: this for t needs to be type A not type test2.A!(int).A
Error: class test2.A!(int).A member t is not accessible
Error: template instance test2.A!(int) error instantiating

However, it does compile if B.blah() is changed to: return this.outer.t
Comment 1 Vladimir Panteleev 2015-05-19 00:29:17 UTC
Works as of 2.065.0.

Fixed by https://github.com/D-Programming-Language/dmd/pull/3019