Re: A proper WAT moment

2019-10-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-10-15 09:06, John Colvin wrote: And all the other ones in my example that access members without an instance that also compile? There's something pretty strange about the rules here. The thing is that it should be possible to access a non-static member without an instance because it

Re: A proper WAT moment

2019-10-15 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 15 October 2019 at 09:34:41 UTC, Simen Kjærås wrote: void fun() { pragma(msg, __LINE__, " ", __traits(compiles,__traits(getMember, S, "e"))); } __traits(compiles) is lying to you again. If you replace it with __traits(getMember, S, "e") ...you'll get an error. Interesting

Re: A proper WAT moment

2019-10-15 Thread Simen Kjærås via Digitalmars-d-learn
On Tuesday, 15 October 2019 at 07:06:35 UTC, John Colvin wrote: On Monday, 14 October 2019 at 19:45:11 UTC, Paul Backus wrote: On Monday, 14 October 2019 at 17:00:56 UTC, John Colvin wrote: Different ability to access a property depending if I'm inside something else when I look? [snip] You

Re: A proper WAT moment

2019-10-15 Thread John Colvin via Digitalmars-d-learn
On Monday, 14 October 2019 at 19:45:11 UTC, Paul Backus wrote: On Monday, 14 October 2019 at 17:00:56 UTC, John Colvin wrote: Different ability to access a property depending if I'm inside something else when I look? [snip] You're attempting to call one of S's member functions without an in

Re: A proper WAT moment

2019-10-14 Thread Paul Backus via Digitalmars-d-learn
On Monday, 14 October 2019 at 17:00:56 UTC, John Colvin wrote: Different ability to access a property depending if I'm inside something else when I look? [snip] You're attempting to call one of S's member functions without an instance of S to call it on. Reduced version: struct S { int