December 16, 2009 [Issue 3618] New: Can't call constructor on immutable/const struct | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=3618 Summary: Can't call constructor on immutable/const struct Product: D Version: 2.036 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: tomeksowi@gmail.com --- Comment #0 from Tomasz Sowiński <tomeksowi@gmail.com> 2009-12-15 16:08:25 PST --- I have problems when using an explicit constructor with structs. It manifests itself when creating a stack variable. immutable struct Strukt { this(int pole) { this.pole = pole; } int pole; } void main() { auto nowy = new Strukt(6); // OK auto s = Strukt(8); // Error: constructor test.Strukt.this (int pole) is not callable using argument types (int) immutable } Same story for const. Side note: If you take off immutable/const, it compiles. Looks similar to Bug 2610. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 07, 2011 [Issue 3618] Can't call constructor on immutable/const struct | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tomasz Sowiński | http://d.puremagic.com/issues/show_bug.cgi?id=3618 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-07 04:43:30 PDT --- Fixed since dmd2.041 -- 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