October 09, 2008 [Issue 2408] New: class declared as invariant cannot have static methods | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2408 Summary: class declared as invariant cannot have static methods Product: D Version: 2.014 Platform: PC OS/Version: Linux Status: NEW Keywords: rejects-valid Severity: critical Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: marcin.wcislo@gmail.com I doubt it's intentional, since it would be nonsense. According to docs: "If a ClassDeclaration has a const or invariant storage class, then it is as if each member of the class was declared with that storage class" Looks like dmd add invariant keyword to static methods too. This obviously leads to an error: function test.Class.method without 'this' cannot be const/invariant Short not-compilable snippet as the proof: invariant class Class { static void method() {} } int main() { return 0; } -- |
June 13, 2011 [Issue 2408] class declared as invariant cannot have static methods | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2408 yebblies <yebblies@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies@gmail.com Resolution| |FIXED --- Comment #1 from yebblies <yebblies@gmail.com> 2011-06-12 22:55:49 PDT --- This works in current dmd 2.053. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation