import std.stdio; struct A { A* p; } int main() { A a; writeln(typeid(a.p)); // Error: need 'this' for 'p' of type 'A*' return 0; }
This is a 2.063.2 regression, unfortunately. It works in 2.062.
https://github.com/D-Programming-Language/dmd/pull/2587
*** Issue 9041 has been marked as a duplicate of this issue. ***
*** Issue 8439 has been marked as a duplicate of this issue. ***
*** Issue 3643 has been marked as a duplicate of this issue. ***
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4d8c25e2aaaa492f6793dcdd7478857ee0a3e3a4 fix Issue 11010 - typeid doesn't work on a member of an instance To distinguish the typeid context, add `bool intypeid` parameter on Type::resolve(). https://github.com/D-Programming-Language/dmd/commit/d9460bfc69ae71acef4418e3b1cdb8de8241bd1f Merge pull request #2587 from 9rnsr/fix11010 [REG2.063] Issue 11010 - typeid doesn't work on a member of an instance
*** Issue 11366 has been marked as a duplicate of this issue. ***