www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - New update fix

reply Salih Dincer <salihdb hotmail.com> writes:
SLM,

What exactly did this patch with the new update fix?
- https://dlang.org/changelog/2.107.0.html#bugfix-list
- https://issues.dlang.org/show_bug.cgi?id=16357

```d
   uint x = 255;
   auto data = cast(ubyte[])[x];

   assert(data[0] == 255);   // ok
   assert(data.length == 4); // error
```

Should it give an assertion error above with this update? Be open 
with wouldn't it be nice to be able to do a binary sum example 
without needing extra code?

```d

   enum p1 = 131071;
   enum p2 = 524287;

void main()
{
   import std.stdio;
   foreach(p; [p1, p2, p1 + p2])
   {
     write("[ ");
     //auto d = [p];
     foreach_reverse(b; cast(ubyte[])[p])
     {
       b.writef!"%08b ";
     }
     writeln("]");
   }
} /* Expected:
[ 00000000 00000001 11111111 11111111 ]
[ 00000000 00000111 11111111 11111111 ]
[ 00000000 00001001 11111111 11111110 ]
*/
```

SDB 79
Mar 02
parent reply user1234 <user1234 12.de> writes:
On Saturday, 2 March 2024 at 08:41:40 UTC, Salih Dincer wrote:
 SLM,

 What exactly did this patch with the new update fix?
Nothing, it looks like what happened is that the issue was wrongly referenced by a dlang.org PR (https://github.com/dlang/dlang.org/pull/3701/commits/4e8db30f0bf3c330c3431e83fe8a75f843b40857).
Mar 02
parent Steven Schveighoffer <schveiguy gmail.com> writes:
On Saturday, 2 March 2024 at 09:18:58 UTC, user1234 wrote:
 On Saturday, 2 March 2024 at 08:41:40 UTC, Salih Dincer wrote:
 SLM,

 What exactly did this patch with the new update fix?
Nothing, it looks like what happened is that the issue was wrongly referenced by a dlang.org PR (https://github.com/dlang/dlang.org/pull/3701/commits/4e8db30f0bf3c330c3431e83fe8a75f843b40857).
Not wrongly referenced. The pr changed the spec to be clearer about the behavior. The behavior did not change. The bug was closed as “fixed” incorrectly. I switched it to “wontfix” The change log generator must have picked it up because of that. -Steve
Mar 03