[Issue 16678] [REG] Fix for issue 16193 creates major breakage

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16678

--- Comment #4 from github-bugzi...@puremagic.com ---
Commit pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/8c00c7ea978dad3236148ea6fa57a1a9f8af3186
Merge pull request #6251 from Dicebot/revert-regressions

Fix Issue 16678 - [REG] Fix for issue 16193 creates major breakage

--


[Issue 16193] opApply() doesn't heap allocate closure

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16193

--- Comment #13 from github-bugzi...@puremagic.com ---
Commit pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/aac715ff2597d256b5ffe8ecb397316abf32fb2e
Revert "fix Issue 16193 - opApply() doesn't heap allocate closure"

This reverts commit f7819c898a05d28297024b7355d4ace94f1e4465.

Fixes issue 16678

--


[Issue 10638] Assignment can't be used as a condition

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10638

Kevin  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||ke...@brogan.ca
 Resolution|--- |WONTFIX

--- Comment #3 from Kevin  ---
D has a number of language features (restrictions?) that are designed to make
buggy code less likely to happen.

A missing equals sign in a comparison is one of those common bugs.

To get around it, you need to be explicit with your intent. An "if statement"
is a poor example to use because you can always place the assignment before the
comparison, but take for example a while loop:

while(line = file.readln())
{
  ...
}

Since readln will return a null string when you reach the end of file input,
the loop will terminate. However, you can't assign in a comparison, so what to
do?

One option is to be explicit in your intent by using a compound statement.

while(line = names.readln(), line)
{
  ...
}

A better option is to be explicit in your comparison as well, using this
example from the documentation:

while ((line = stdin.readln()) !is null)
{
  ...
}


The example that you give isn't the best, since your assignment always
evaluates to true, but perhaps you would prefer these examples:

if (i = getValue(), i) { ... }
if ((i = getValue()) == 1) { ... }

--


[Issue 4851] Three suggestions for std.random

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4851

Eduard Staniloiu  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #9 from Eduard Staniloiu  ---
I have created a PR that adds the choice function to std.random. The link is
below:

https://github.com/dlang/phobos/pull/4897

--


[Issue 3880] std.regex functions with const/immutable Regex object

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3880

John Colvin  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||john.loughran.colvin@gmail.
   ||com
 Resolution|FIXED   |---

--- Comment #2 from John Colvin  ---
Seems like this is still happening:

auto foo()
{
import std.regex : regex, matchFirst;
const r = regex("asdf");
matchFirst("fdsaf", r);
}

test.d(5): Error: template std.regex.matchFirst cannot deduce function from
argument types !()(string, const(Regex!char)), candidates are:
/usr/local/Cellar/dmd/2.072.0/include/dlang/dmd/std/regex/package.d(934):  
 std.regex.matchFirst(R, RegEx)(R input, RegEx re) if (isSomeString!R &&
is(RegEx == Regex!(BasicElementOf!R)))
/usr/local/Cellar/dmd/2.072.0/include/dlang/dmd/std/regex/package.d(942):  
 std.regex.matchFirst(R, String)(R input, String re) if (isSomeString!R &&
isSomeString!String)
/usr/local/Cellar/dmd/2.072.0/include/dlang/dmd/std/regex/package.d(950):  
 std.regex.matchFirst(R, String)(R input, String[] re...) if (isSomeString!R &&
isSomeString!String)
/usr/local/Cellar/dmd/2.072.0/include/dlang/dmd/std/regex/package.d(957):  
 std.regex.matchFirst(R, RegEx)(R input, RegEx re) if (isSomeString!R &&
is(RegEx == StaticRegex!(BasicElementOf!R)))

--


[Issue 16681] ICE 1662

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16681

--- Comment #1 from Илья Ярошенко  ---
PR https://github.com/dlang/phobos/pull/4896

--


[Issue 16681] ICE 1662

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16681

Илья Ярошенко  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--


[Issue 16681] ICE 1662

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16681

Илья Ярошенко  changed:

   What|Removed |Added

   Keywords||ice, SIMD

--


[Issue 16681] ICE 1662

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16681

Илья Ярошенко  changed:

   What|Removed |Added

   Hardware|x86 |All

--


[Issue 16681] New: ICE 1662

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16681

  Issue ID: 16681
   Summary: ICE 1662
   Product: D
   Version: D2
  Hardware: x86
OS: All
Status: NEW
  Severity: major
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ilyayaroshe...@gmail.com

The unittest from 
/++
SIMD Vectors
Bugs: ICE 1662 (dmd only)
+/
unittest
{
import core.simd;
double2 a = 1, b = 2, c = 3, d = 6;
with(Summation)
{
foreach (algo; AliasSeq!(naive, fast, pairwise, kahan))
{
assert([a, b, c].sum!algo.array == d.array);
assert([a, b].sum!algo(c).array == d.array);
}
}
}

--


[Issue 16504] [REG 2.072a]`dup` can't use storage class `scope` for its parameter in general

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16504

--- Comment #2 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/ce6aef38adbf7f652db67bc7287a97e45c173b8f
Revert "Merge pull request #1637 from WalterBright/scope-dup"

https://github.com/dlang/druntime/commit/2f3f7c80d9843f4c2de05fdd2e15af71f185cf62
add unittest example for Issue 16504

--


[Issue 16651] atomicOp!"-="(ulong, uint) = wrong result/codegen

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16651

--- Comment #4 from github-bugzi...@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/44f45280b7fe308731611801385f8c6226214682
fix issue 16651 - atomicOp!"-="(ulong, uint) = wrong result/codegen

https://github.com/dlang/druntime/commit/422c8f7b0f0e6598910737981074e0c45a4eb1b9
Merge pull request #1690 from aG0aep6G/16651

fix issue 16651 - atomicOp!"-="(ulong, uint) = wrong result/codegen

--


[Issue 16651] atomicOp!"-="(ulong, uint) = wrong result/codegen

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16651

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 16663] [REG 2.072] std.unit.toUpper rejects an alias this to a string

2016-11-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16663

--- Comment #4 from anonymous4  ---
This probably falls under the same argument: this String is not supposed to be
a range. Maybe extension of range functions to collections (autorangification)
is in order.

--