March 20, 2012 [Issue 7737] New: std.typecons.Typedef problem with immutable initialized in static this() | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=7737 Summary: std.typecons.Typedef problem with immutable initialized in static this() Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody@puremagic.com ReportedBy: bearophile_hugs@eml.cc --- Comment #0 from bearophile_hugs@eml.cc 2012-03-19 17:22:46 PDT --- I don't know if it's possible to fix this just changing Phobos. Maybe more is needed. Tests performed with DMD 2.059head: This compiles: alias int[] Arr; immutable Arr a; pure nothrow static this() { a = [1, 2, 3]; } void main() {} This compiles (with -d): typedef int[] Arr; immutable Arr a; pure nothrow static this() { a = [1, 2, 3]; } void main() {} This compiles: import std.typecons: Typedef; alias Typedef!(int[]) Arr; Arr a; nothrow static this() { a = [1, 2, 3]; } void main() {} But this doesn't compile: import std.typecons: Typedef; alias Typedef!(int[]) Arr; immutable Arr a; pure nothrow static this() { a = [1, 2, 3]; } void main() {} It gives: test.d(5): Error: template std.typecons.Typedef!(int[],null).Typedef.Proxy!(Typedef_payload).opAssign(this X,V) does not match any function template declaration test.d(5): Error: template std.typecons.Typedef!(int[],null).Typedef.Proxy!(Typedef_payload).opAssign(this X,V) cannot deduce template function from argument types !()(int[]) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
March 12, 2013 [Issue 7737] std.typecons.Typedef problem with immutable initialized in static this() | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=7737 Kenji Hara <k.hara.pg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |9665 --- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2013-03-11 18:34:28 PDT --- This is non-const object initialization problem. -- 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