digitalmars.D.bugs - [Issue 5516] New: .init is broken for fields
- d-bugmail puremagic.com (31/31) Feb 01 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5516
- d-bugmail puremagic.com (13/13) May 20 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5516
http://d.puremagic.com/issues/show_bug.cgi?id=5516 Summary: .init is broken for fields Product: D Version: unspecified Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: andrej.mitrovich gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2011-02-01 17:43:35 PST --- struct Foo { int a; int b = 7; } void main() { Foo foo; assert(foo.b == 7); assert(foo.b.init == 7); // assertion failure } According to docs: .init produces a constant expression that is the default initializer. If applied to a type, it is the default initializer for that type. If applied to a variable or *field*, it is the default initializer for that variable or field. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 01 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5516 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2011-05-20 18:31:55 PDT --- Invalid, code should be: Foo.init.b There's another report for the bug in docs so I'm closing this down. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 20 2011