[Issue 19331] New: std.regex.internal.ir.SmallFixedArray.toHash is ignored because it's non-const

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19331

  Issue ID: 19331
   Summary: std.regex.internal.ir.SmallFixedArray.toHash is
ignored because it's non-const
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: n8sh.second...@hotmail.com

std.regex.internal.ir.SmallFixedArray defines a non-const `toHash` function
that is ignored by TypeInfo.getHash due to not being const.

--


[Issue 19331] std.regex.internal.ir.SmallFixedArray.toHash is ignored because it's non-const

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19331

--- Comment #1 from Nathan S.  ---
Pull request: https://github.com/dlang/phobos/pull/6739

--


[Issue 12761] rvalue object with alias this to lvalue produces rvalue

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12761

RazvanN  changed:

   What|Removed |Added

 CC||razvan.nitu1...@gmail.com

--- Comment #1 from RazvanN  ---
This bug report is invalid. Alias this creates a subtyping relation between S
and I and should behave as inheritance in the case of classes. Take this
example which represents the same pattern but in the case of classes:

class A {}
class B : A {}

void fun(ref A a) {}

void main()
{
fun(new B());
}

You will get the same error: 

issue.d(8): Error: function issue.fun(ref A a) is not callable using argument
types (B)
issue.d(8):cannot pass rvalue argument new B of type issue.B to
parameter ref A a

--


[Issue 12761] rvalue object with alias this to lvalue produces rvalue

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12761

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--


[Issue 12761] rvalue object with alias this to lvalue produces rvalue

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12761

--- Comment #2 from RazvanN  ---
This bug report is invalid. Alias this creates a subtyping relation between S
and int and should behave as inheritance in the case of classes. Take this
example which represents the same pattern but in the case of classes:

class A {}
class B : A {}

void fun(ref A a) {}

void main()
{
fun(new B());
}

You will get the same error: 

issue.d(8): Error: function issue.fun(ref A a) is not callable using argument
types (B)
issue.d(8):cannot pass rvalue argument new B of type issue.B to
parameter ref A a

Closing as invalid.

--


[Issue 19331] std.regex.internal.ir.SmallFixedArray.toHash is ignored because it's non-const

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19331

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

https://github.com/dlang/phobos/commit/725278b2ceb06dee2ccd5899d10a0ca1f542fec3
Fix Issue 19331 - std.regex.internal.ir.SmallFixedArray.toHash is ignored
because it's non-const

--


[Issue 19331] std.regex.internal.ir.SmallFixedArray.toHash is ignored because it's non-const

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19331

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

   What|Removed |Added

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

--


[Issue 16426] Templated opAssign do not forward on Alias this.

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16426

RazvanN  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--


[Issue 19332] New: hashOf fails for const struct that has non-const toHash & has all fields bitwise-hashable

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19332

  Issue ID: 19332
   Summary: hashOf fails for const struct that has non-const
toHash & has all fields bitwise-hashable
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: n8sh.second...@hotmail.com

Example:

---
struct NotOkay
{
int canBitwiseHashInts;
size_t toHash() /* not const */ { return 0; }
}

struct Okay
{
float cantBitwiseHashFloats;
size_t toHash() /* not const */ { return 0; }
}

void main()
{
const okay = Okay.init;
hashOf(okay); // Compiles but writes a message about the non-callable
toHash.

const notOkay = NotOkay.init;
hashOf(notOkay); // Compilation fails!
}
---

--


[Issue 19332] hashOf fails to compile for const struct that has non-const toHash & has all fields bitwise-hashable

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19332

Nathan S.  changed:

   What|Removed |Added

Summary|hashOf fails for const  |hashOf fails to compile for
   |struct that has non-const   |const struct that has
   |toHash & has all fields |non-const toHash & has all
   |bitwise-hashable|fields bitwise-hashable

--


[Issue 313] [module] Fully qualified names bypass private imports

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=313

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

https://github.com/dlang/dmd/commit/aca10e8a720d8a00a09184e5fc065665ca3a2c13
Turn deprecation into error for issue 313

https://github.com/dlang/dmd/commit/01a6a5e26f7d2ed6fdab9286566ece803862c48a
Merge pull request #8443 from RazvanN7/checkAccess_err

Turn deprecation into error for issue 313
merged-on-behalf-of: Sebastian Wilzbach 

--


[Issue 19332] hashOf fails to compile for const struct that has non-const toHash & has all fields bitwise-hashable

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19332

--- Comment #1 from Nathan S.  ---
Pull request: https://github.com/dlang/druntime/pull/2337

--


[Issue 16082] Can't access alias this member with same name as module

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16082

RazvanN  changed:

   What|Removed |Added

 CC||razvan.nitu1...@gmail.com

--- Comment #1 from RazvanN  ---
PR : https://github.com/dlang/dmd/pull/8868

--


[Issue 16618] [REG2.055] Segmentation fault in DMD with cyclic alias this and unknown identifier

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16618

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |FIXED

--- Comment #3 from RazvanN  ---
Compiling this with dmd 2.081 issues:

Error: undefined identifier embed_instance

and no seg fault. Closing as fixed

--


[Issue 15984] [REG2.071] Interface contracts retrieve garbage instead of parameters

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15984

FeepingCreature  changed:

   What|Removed |Added

 CC||default_357-l...@yahoo.de

--- Comment #17 from FeepingCreature  ---
Helpful reminder that it's Q4 2018 and DMD still generates crashing code with
no warning when using a simple, officially documented and advertised language
feature.

--


[Issue 19333] New: Add float, double and real overloads over volatileLoad and volatileStore

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19333

  Issue ID: 19333
   Summary: Add float, double and real overloads over volatileLoad
and volatileStore
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ibuc...@gdcproject.org

These might be useful for the buggy std.math tests where clever compilers don't
raise FE flags if it is able to const-fold the value at compile time - such as
GDC or LDC

For example, the following test returns false for `ieeeFlags.inexact` with
optimizations on.

```
() { x = 1; x += 0.1; },
() => ieeeFlags.inexact
```

So we would benefit from instead writing it as:

```
() { volatileStore(&x, 1); volatileStore(&x, x + 0.1); }
() => ieeeFlags.inexact
```

Which should be guaranteed to be true if the compiler adheres to correct
volatile semantics.

--


[Issue 13826] Move volatileLoad/Store to core.volatile when the volatile keyword is removed

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13826

Iain Buclaw  changed:

   What|Removed |Added

 CC||ibuc...@gdcproject.org

--- Comment #2 from Iain Buclaw  ---
Compiler support: https://github.com/dlang/dmd/pull/8869

--


[Issue 19334] New: Derived class can access private members if class have a package member variable.

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19334

  Issue ID: 19334
   Summary: Derived class can access private members if class have
a package member variable.
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: critical
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: alexanderheisterm...@gmail.com

import std.stdio;
class A
{
package int x;
private int y;
}

class B : A
{
};

void main()
{
B b = new B();
b.y = 1; // Should be a compile error
writeln(b.y);
writeln(b.x);
}

Remove "package int x" and it works as intended.

--


[Issue 19274] Inconsistent assignment behavior between struct values and fixed-size arrays

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19274

--- Comment #1 from Stanislav Blinov  ---
Some more reference:
https://forum.dlang.org/post/qluloffxckkpvhghg...@forum.dlang.org

--


[Issue 19334] Derived class can access private members in same module

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19334

alexanderheisterm...@gmail.com changed:

   What|Removed |Added

Summary|Derived class can access|Derived class can access
   |private members if class|private members in same
   |have a package member   |module
   |variable.   |

--


[Issue 19334] Derived class inheritance private members in same module

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19334

alexanderheisterm...@gmail.com changed:

   What|Removed |Added

Summary|Derived class can access|Derived class inheritance
   |private members in same |private members in same
   |module  |module

--


[Issue 19334] Derived class inheritance private members in same module

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19334

--- Comment #1 from alexanderheisterm...@gmail.com ---
Scratch that, it still accepts invalid code even package int x is removed.
Class b shouldn't have property y, as property y only exist at class A not
class B.

import std.stdio;
class A
{
private int y;
}

class B : A
{
};

void main()
{
B b = new B();
b.y = 1; // Should be a compile error as class shouldn't have private int
y.
writeln(b.y);
}

--


[Issue 19334] Derived class inheritance private members in same module

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19334

Mike Parker  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||aldac...@gmail.com
 Resolution|--- |INVALID

--- Comment #2 from Mike Parker  ---
This is not a bug and is working as intended:

"Symbols with private visibility can only be accessed from within the same
module."

https://dlang.org/spec/attribute.html#visibility_attributes

--


[Issue 19335] New: std.getopt: make it an error to have options that differ only by case when case insensitive

2018-10-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19335

  Issue ID: 19335
   Summary: std.getopt: make it an error to have options that
differ only by case when case insensitive
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: dhase...@gmail.com

void main(string[] args)
{
import std.getopt;
import std.stdio;
int a, A;
getopt(args, "a", &a, "A", &A);
writefln("a=%s, A=%s", a, A);
}

Compile, run with `-a 5 -A 10`.

The expected result is an exception saying that option `A|a` is multiply
defined, hopefully also mentioning that the case-sensitive flag exists.

The actual result is that `a` is set twice and `A` is not set.

This exception should also trigger when you define an argument named `H`.

(I would also argue that case-insensitive is a terrible default, but that's
unlikely to change.)

--