D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7935 - Struct-by-pointer field access in TypeTuple
Summary: Struct-by-pointer field access in TypeTuple
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 minor
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2012-04-17 14:43 UTC by bearophile_hugs
Modified: 2015-05-19 01:02 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2012-04-17 14:43:43 UTC
This is wrong D2 code:


import std.typecons: TypeTuple;
struct Node {
    Node* left, right;
}
void main() {
    Node* n = new Node();
    auto le = n.left;
    auto t = TypeTuple!(n.left);
}



DMD 2.059 gives this error message, but I think it's better to give a different error message:

test.d(8): Error: no property 'left' for type 'Node*'
Comment 1 Vladimir Panteleev 2015-05-19 01:02:52 UTC
Is 2.063 this emits "variable n cannot be read at compile time" which is more appropriate.

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