digitalmars.D.bugs - [Issue 1727] New: Associate Array Literals regression
- d-bugmail puremagic.com (16/16) Dec 11 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1727
- d-bugmail puremagic.com (10/10) Dec 11 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1727
- Don Clugston (3/8) Dec 12 2007 When did this ever compile? I think this is an unimplemented feature, no...
- Jarrett Billingsley (4/12) Dec 12 2007 Uh, are you talking about AA literals? They've been in D since 1.014 (A...
- Matti Niemenmaa (6/20) Dec 12 2007 It won't compile at global scope, and never has.
- Jarrett Billingsley (5/8) Dec 12 2007 Then it's not a bug in any way, is it? It's stupid, but according to sp...
- Matti Niemenmaa (6/17) Dec 12 2007 I don't have a 2.0 installation handy so I don't know, but yes: if it wo...
- d-bugmail puremagic.com (12/12) Dec 13 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1727
- d-bugmail puremagic.com (19/19) Dec 13 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1727
- d-bugmail puremagic.com (24/24) Dec 13 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1727
- d-bugmail puremagic.com (9/9) Oct 25 2008 http://d.puremagic.com/issues/show_bug.cgi?id=1727
http://d.puremagic.com/issues/show_bug.cgi?id=1727 Summary: Associate Array Literals regression Product: D Version: 2.008 Platform: PC OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: davidl 126.com Following does not compile: int[char[]] ca= [cast(char[])"asdf":1,cast(char[])"asdf1":2]; --
Dec 11 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1727 davidl 126.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major Priority|P2 |P1 It's blocking my code from porting to D2.0. So I mark this at a little higher priority . --
Dec 11 2007
d-bugmail puremagic.com wrote:http://d.puremagic.com/issues/show_bug.cgi?id=1727 Summary: Associate Array Literals regression Following does not compile: int[char[]] ca= [cast(char[])"asdf":1,cast(char[])"asdf1":2];When did this ever compile? I think this is an unimplemented feature, not a regression.
Dec 12 2007
"Don Clugston" <dac nospam.com.au> wrote in message news:fjoue2$o1o$1 digitalmars.com...d-bugmail puremagic.com wrote:Uh, are you talking about AA literals? They've been in D since 1.014 (April 26).. this code works with D1.http://d.puremagic.com/issues/show_bug.cgi?id=1727 Summary: Associate Array Literals regression Following does not compile: int[char[]] ca= [cast(char[])"asdf":1,cast(char[])"asdf1":2];When did this ever compile? I think this is an unimplemented feature, not a regression.
Dec 12 2007
Jarrett Billingsley wrote:"Don Clugston" <dac nospam.com.au> wrote in message news:fjoue2$o1o$1 digitalmars.com...It won't compile at global scope, and never has. http://www.digitalmars.com/d/1.0/expression.html#AssocArrayLiteral "An AssocArrayLiteral cannot be used to statically initialize anything." -- E-mail address: matti.niemenmaa+news, domain is iki (DOT) fid-bugmail puremagic.com wrote:Uh, are you talking about AA literals? They've been in D since 1.014 (April 26).. this code works with D1.http://d.puremagic.com/issues/show_bug.cgi?id=1727 Summary: Associate Array Literals regression Following does not compile: int[char[]] ca= [cast(char[])"asdf":1,cast(char[])"asdf1":2];When did this ever compile? I think this is an unimplemented feature, not a regression.
Dec 12 2007
"Matti Niemenmaa" <see_signature for.real.address> wrote in message news:fjpbvo$1s6a$1 digitalmars.com...It won't compile at global scope, and never has. http://www.digitalmars.com/d/1.0/expression.html#AssocArrayLiteral "An AssocArrayLiteral cannot be used to statically initialize anything."Then it's not a bug in any way, is it? It's stupid, but according to spec. And it's not a regression because nothing changed. It works fine in 2.008 too.
Dec 12 2007
Jarrett Billingsley wrote:"Matti Niemenmaa" <see_signature for.real.address> wrote in message news:fjpbvo$1s6a$1 digitalmars.com...I don't have a 2.0 installation handy so I don't know, but yes: if it works fine when doing the initialization in a static constructor, for instance, then it's not a bug. -- E-mail address: matti.niemenmaa+news, domain is iki (DOT) fiIt won't compile at global scope, and never has. http://www.digitalmars.com/d/1.0/expression.html#AssocArrayLiteral "An AssocArrayLiteral cannot be used to statically initialize anything."Then it's not a bug in any way, is it? It's stupid, but according to spec. And it's not a regression because nothing changed. It works fine in 2.008 too.
Dec 12 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1727 davidl 126.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |regression Oh, you remind me that the severity is regression. It compiles by D1.X compilers. And spec gives a simplest example with same length string literals If I remember correctly: int[char[]] aa=["aa":1,"bb":2,"cc":3]; --
Dec 13 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1727 matti.niemenmaa+dbugzilla iki.fi changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID ------- It has never compiled, neither in 1.0 nor in 2.0. http://www.digitalmars.com/d/expression.html#AssocArrayLiteral gives the example "[21u:"he",38:"ho",2:"hi"];" but doesn't assign it to anything. It also says "[a]n AssocArrayLiteral cannot be used to statically initialize anything." This means that code of the form "<associative array type> foo = <associative array literal>" doesn't work, nor has it ever. Unless code like the following fails, this is an invalid bug: int[char[]] a; static this() { a = ["aa":1,"bb":2,"cc":3]; } --
Dec 13 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1727 gide nwawudu.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID | The following code compiles on both GDC and DMD, but DMD compiled code throws an array bounds exception when executed. I think DMD might have a bug. test.d ------ import std.stdio; void main() { int[char[]] aa = ["aa":1, "bb":2, "cc":3]; // Fails //int[char[]] aa; aa = ["aa":1, "bb":2, "cc":3]; // Fails //int[char[]] aa; aa["aa"] = 1; aa["bb"] = 2; aa["cc"] = 3; // OK assert(aa.length == 3); assert(aa["aa"]==1); // Fails on DMD 2.008. Error: ArrayBoundsError test(8) assert(aa["bb"]==2); assert(aa["cc"]==3); writefln(aa["aa"],aa["bb"],aa["cc"]); // On GDC outputs: 123 } --
Dec 13 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1727 gide nwawudu.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED Fixed in DMD v2.020 --
Oct 25 2008