digitalmars.D.bugs - [Issue 2202] New: Error getting type of non-static member of a class
- d-bugmail puremagic.com (19/19) Jul 08 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2202
- d-bugmail puremagic.com (6/6) Jul 08 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2202
- d-bugmail puremagic.com (14/14) Jul 08 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2202
- d-bugmail puremagic.com (10/10) Jul 08 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2202
- d-bugmail puremagic.com (12/12) Jul 08 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2202
- d-bugmail puremagic.com (5/10) Jul 08 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2202
- d-bugmail puremagic.com (4/5) Jul 08 2008 C.x is not a valid expression?
- Jarrett Billingsley (7/11) Jul 09 2008 What's it supposed to give? It's an instance variable. It's syntactica...
- Max Samukha (6/23) Jul 09 2008 Sometimes I just fail to express myself. I should have asked "C.x is
- d-bugmail puremagic.com (17/17) Sep 04 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2202
- d-bugmail puremagic.com (30/30) Sep 04 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2202
- d-bugmail puremagic.com (12/12) Oct 06 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2202
http://d.puremagic.com/issues/show_bug.cgi?id=2202 Summary: Error getting type of non-static member of a class Product: D Version: 2.015 Platform: PC OS/Version: Windows Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: samukha voliacable.com The following fails with 'Error: this for x needs to be type C not type int': class C { int x; } typeof(C.x) z; --
Jul 08 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2202 Not sure if that's really a bug or not. I lean towards "no" since typeof is supposed to take a variable, and C.x is not a variable. You can get what you want with typeof(C.init.x). --
Jul 08 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2202 I'm not sure either as it worked before but is not mentioned in the specs. I wouldn't post it as bug if the following compiled: static assert (!is(typeof(C.x))); // Fails with the same error, should pass static assert (!__traits(compiles, C.x)); // Should pass ... and if this didn't compile: struct S { int x; } typeof(S.x) y; // Why this compiles then? So it is either a regression or we have other bugs and inconsistencies. --
Jul 08 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2202 davidl 126.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE in the essence, it's duplicated with bug 515 *** This bug has been marked as a duplicate of 515 *** --
Jul 08 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2202 matti.niemenmaa+dbugzilla iki.fi changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED OS/Version|Windows |All Platform|PC |All Resolution|DUPLICATE | ------- No, 515 is about whether .offsetof is static or not. This is about whether typeof(Class.nonstatic) should be allowed. --
Jul 08 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2202Not sure if that's really a bug or not. I lean towards "no" since typeof is supposed to take a variable, and C.x is not a variable.It's supposed to take an expression. C.x is an expression.You can get what you want with typeof(C.init.x).--
Jul 08 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2202It's supposed to take an expression. C.x is an expression.C.x is not a valid expression? --
Jul 08 2008
<d-bugmail puremagic.com> wrote in message news:g51hs4$rq7$1 digitalmars.com...http://d.puremagic.com/issues/show_bug.cgi?id=2202What's it supposed to give? It's an instance variable. It's syntactically an expression, but semantically it makes no sense, it has no value. Interestingly, &C.method works. Thankfully. Hope that never breaks. But that's maybe because functions are statically allocated, unlike instance variables.It's supposed to take an expression. C.x is an expression.C.x is not a valid expression?
Jul 09 2008
On Wed, 9 Jul 2008 09:31:13 -0400, "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote:<d-bugmail puremagic.com> wrote in message news:g51hs4$rq7$1 digitalmars.com...Sometimes I just fail to express myself. I should have asked "C.x is not a valid expression, is it?", or better: "C.x is an invalid expression, isn't it?" Or something like that.http://d.puremagic.com/issues/show_bug.cgi?id=2202What's it supposed to give? It's an instance variable. It's syntactically an expression, but semantically it makes no sense, it has no value.It's supposed to take an expression. C.x is an expression.C.x is not a valid expression?Interestingly, &C.method works. Thankfully. Hope that never breaks. But that's maybe because functions are statically allocated, unlike instance variables.I rely on &C.method too.
Jul 09 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2202 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug yahoo.com.au This example shows it's definitely a bug (1.047): class C { int x; } alias C.x F; static assert(is(typeof(F) == int)); // OK static assert(is(typeof(C.x) == int)); //Error: static assert (is(int == int)) is false -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 04 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2202 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch PATCH: mtype.c, in TypeClass::dotExp(), around line 6350 in D2.032. Don't convert class.x into this.x if inside a typeof() and we don't have a 'this'. -------- /* It's: * Class.d */ if (d->isTupleDeclaration()) { e = new TupleExp(e->loc, d->isTupleDeclaration()); e = e->semantic(sc); return e; } - else if (d->needThis() && (hasThis(sc) || !d->isFuncDeclaration())) + else if (d->needThis() && (hasThis(sc) || (!sc->intypeof && !d->isFuncDeclaration()))) { if (sc->func) { ClassDeclaration *thiscd; thiscd = sc->func->toParent()->isClassDeclaration(); ------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 04 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2202 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED 02:13:59 PDT --- Fixed dmd 1.048 and 2.033 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 06 2009