[Issue 20233] opDispatch hides alias this properties

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20233

--- Comment #1 from Lorenzo Cogotti  ---
Sorry, there was a typo in my code listing, here is the correct version,
producing the same errors:

-
module main;

struct Point
{
int[2] coords;

alias coords this;

auto opDispatch(string name, A...)(A args)
{
return mixin("this.coords." ~ name ~ "(args)");
}
}

void main()
{
import std.stdio;

Point p;
writeln(p.ptr, p.length);
}

--


[Issue 6434] opDispatch must be considered before alias this.

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6434

Lorenzo Cogotti  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=20233

--


[Issue 20233] New: opDispatch hides alias this properties

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20233

  Issue ID: 20233
   Summary: opDispatch hides alias this properties
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: mi...@inventati.org

In presence of `alias this`, `opDispatch` causes the compiler to ignore
any plain member of the aliased field which is not a property nor a callable
method. This reduces `alias this` usefulness and is possibly a bug.

This is possibly caused by the fact that `opDispatch` takes precedence
over `alias this`.

-
module main;

struct Point
{
int[2] coords;

alias coords this;

auto opDispatch(string name, A...)(args)
{
return mixin("this.coords." ~ name ~ "(args)");
}
}

void main()
{
import std.stdio;

Point p;
writeln(p.ptr, p.length);
}

-

$ dmd alias-dispatch.d 
alias-dispatch.d(20): Error: no property ptr for type Point
alias-dispatch.d(20): Error: no property length for type Point

--


[Issue 16047] Range violation in setting multi-dimensional AA entries

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #4 from Dlang Bot  ---
@FeepingCreature updated dlang/dmd pull request #10422 "fix issue 16048: range
error when assigning nested aa with temporary" fixing this issue:

- fix issue 16047: when extracting temporaries from an index expression for
assignment, mark the expression as assigning.
  This avoids the temporaries encountering a range error with nested
associative arrays.

https://github.com/dlang/dmd/pull/10422

--


[Issue 16047] Range violation in setting multi-dimensional AA entries

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

--- Comment #3 from FeepingCreature  ---
What happens here is that the complex expression for the first index forces DMD
to allocate a temporary. In the course of doing so, it forgets to indicate that
the temporary is for a nested assignment, and the temporary (which is a plain
IndexExp, not an assignment) runs into a range error.

--


[Issue 20149] [DIP1000] Local data escapes `inout` method if not decorated with `return`

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #17 from Dlang Bot  ---
@rainers updated dlang/druntime pull request #2805 "fix Issue 20227 - "Error:
phread_mutex_destroy failed." after fork()" mentioning this issue:

- Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

- Merge pull request #2785 from JinShil/fix_20149

  Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue
20149

https://github.com/dlang/druntime/pull/2805

--


[Issue 20227] "Aborting from src/core/sync/event.d(141) Error: pthread_mutex_destroy failed." after fork()

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20227

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #4 from Dlang Bot  ---
@rainers created dlang/druntime pull request #2805 "fix Issue 20227 - "Error:
phread_mutex_destroy failed." after fork()" fixing this issue:

- fix Issue 20227 - "Aborting from src/core/sync/event.d(141) Error:
pthread_mutex_destroy failed." after fork()

  clear thread handles and events for parallel marking in child process after
fork

https://github.com/dlang/druntime/pull/2805

--


[Issue 16047] Range violation in setting multi-dimensional AA entries

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

FeepingCreature  changed:

   What|Removed |Added

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

--- Comment #2 from FeepingCreature  ---
Tighter repro:

struct Reassignable
{
void opAssign(Reassignable) {}
}

int s() { return 1; }

void main()
{
Reassignable[int][int] aa;

aa[0][0] = Reassignable.init;
aa[s()][0] = Reassignable.init; // range violation
}

--


[Issue 16047] Range violation in setting multi-dimensional AA entries

2019-09-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16047

--- Comment #1 from Mario Kroeplin  ---
Workaround: use `require`

aa.require(S("baz").s, null)["baz"] = SysTime.init;

--