Thread overview | ||||||
---|---|---|---|---|---|---|
|
September 19, 2011 [Issue 6691] New: static constructor inside template cannot initialize immutable template members | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6691 Summary: static constructor inside template cannot initialize immutable template members Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: k.hara.pg@gmail.com --- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 2011-09-18 18:43:52 PDT --- Follwing should compile, but can't. template Hoge() { immutable static int[int] dict; immutable static int value; static this() { dict = [1:1, 2:2]; value = 10; } } alias Hoge!() H; -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 19, 2011 [Issue 6691] static constructor inside template cannot initialize immutable template members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kenji Hara | http://d.puremagic.com/issues/show_bug.cgi?id=6691 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-09-18 19:24:31 PDT --- https://github.com/D-Programming-Language/dmd/pull/392 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 21, 2011 [Issue 6691] static constructor inside template cannot initialize immutable template members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kenji Hara | http://d.puremagic.com/issues/show_bug.cgi?id=6691 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla@digitalmars.com Resolution| |FIXED --- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-09-20 22:53:48 PDT --- https://github.com/D-Programming-Language/dmd/commit/6fd9beafb3c7ff9dff71e3499ee404818d1e0aea -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
September 21, 2011 [Issue 6691] static constructor inside template cannot initialize immutable template members | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kenji Hara | http://d.puremagic.com/issues/show_bug.cgi?id=6691 bearophile_hugs@eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bearophile_hugs@eml.cc --- Comment #3 from bearophile_hugs@eml.cc 2011-09-21 00:02:26 PDT --- Keep in mind that there are cases more important than this one that currently don't work: struct Foo { immutable int[1] arr; this(int x) { arr[0] = 1; } } auto f = Foo(1); void main() {} -- 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