Bug 9041 – "Need 'this' to access member" of inner class in typeid
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-17T12:49:00Z
Last change time
2013-09-26T07:12:24Z
Assigned to
nobody
Creator
freeslave93
Comments
Comment #0 by freeslave93 — 2012-11-17T12:49:41Z
The following code generates error "need 'this' to access member b"
import std.stdio;
class B
{
}
class A
{
B b;
}
int main(string[] args)
{
static assert(is(typeof( {A a = new A; writeln(typeid(a.b));}))); //pass
//same but out of static assert
A a = new A;
writeln(typeid(a.b)); //error
return 0;
}
But it's ok if we replace class B with struct.
Comment #1 by andrej.mitrovich — 2013-09-26T07:12:24Z
The pull in Issue 11010 fixes this.
*** This issue has been marked as a duplicate of issue 11010 ***