[Issue 7183] Bad error message when trying to use this in a static member function of a struct
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Dec 29 10:02:11 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7183
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
CC| |clugdbug at yahoo.com.au
OS/Version|Linux |All
--- Comment #1 from Don <clugdbug at yahoo.com.au> 2011-12-29 10:02:03 PST ---
The class error message is generated in the front-end. The struct error message
is generated in the glue layer. Apart from the diagnostic issue, the error
should really be generated in the front-end.
Having it in the glue layer creates problems for CTFE. The following example
errors with "variable x is used before initialization" which is nonsense.
struct BadError
{
double x = 2.0;
static int comparex()
{
return (this.x <= 3.0);
}
}
static assert({ BadError z; z.comparex(); return true; }());
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list