Issue 11010 - Regression (2.063.2) typeid doesn't work on a member of an instance.
Summary: Regression (2.063.2) typeid doesn't work on a member of an instance.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
: 3643 8439 9041 11366 (view as issue list)
Depends on:
Blocks:
 
Reported: 2013-09-11 03:49 UTC by Elvis Zhou
Modified: 2013-11-02 05:53 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Elvis Zhou 2013-09-11 03:49:44 UTC
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;
}
Comment 1 Andrej Mitrovic 2013-09-17 12:59:48 UTC
This is a 2.063.2 regression, unfortunately. It works in 2.062.
Comment 3 Andrej Mitrovic 2013-09-26 07:12:24 UTC
*** Issue 9041 has been marked as a duplicate of this issue. ***
Comment 4 Andrej Mitrovic 2013-09-26 07:14:47 UTC
*** Issue 8439 has been marked as a duplicate of this issue. ***
Comment 5 Andrej Mitrovic 2013-09-26 07:19:44 UTC
*** Issue 3643 has been marked as a duplicate of this issue. ***
Comment 6 github-bugzilla 2013-09-26 16:53:10 UTC
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
Comment 7 Kenji Hara 2013-11-02 05:53:58 UTC
*** Issue 11366 has been marked as a duplicate of this issue. ***