[Issue 17441] std.traits.moduleName gives wrong answer for modules imported under a different name in a mixin

2020-02-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17441

--- Comment #7 from Dlang Bot  ---
dlang/dmd pull request #10753 "Merge remote-tracking branch 'upstream/stable'
into merge_stable" was merged into master:

- b7c279fe6069b73569f781d7dbedb2ff100f546d by Boris Carvajal:
  Fix Issue 17441 - Template instantiation reused when arguments are mo…
(#10724)

  Fix Issue 17441 - Template instantiation reused when arguments are mo…
  merged-on-behalf-of: Nicholas Wilson 

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

--


[Issue 17441] std.traits.moduleName gives wrong answer for modules imported under a different name in a mixin

2020-01-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17441

Dlang Bot  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Dlang Bot  ---
dlang/dmd pull request #10724 "Fix Issue 17441 - Template instantiation reused
when arguments are mo…" was merged into stable:

- 909f8db921ac52669c0a2832408b21ca12743112 by Boris Carvajal:
  Fix Issue 17441 - Template instantiation reused when arguments are module and
package with same name

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

--


[Issue 17441] std.traits.moduleName gives wrong answer for modules imported under a different name in a mixin

2020-01-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17441

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #5 from Dlang Bot  ---
@BorisCarvajal created dlang/dmd pull request #10724 "Fix Issue 17441 -
Template instantiation reused when arguments are mo…" fixing this issue:

- Fix Issue 17441 - Template instantiation reused when arguments are module and
package with same name

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

--


[Issue 17441] std.traits.moduleName gives wrong answer for modules imported under a different name in a mixin

2020-01-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17441

Boris Carvajal  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||boris...@gmail.com
 Resolution|DUPLICATE   |---

--- Comment #4 from Boris Carvajal  ---
Although similar to issue 14501 this doesn't deal with enums (that seems more
hard to fix).

I have a working solution for the examples except the Atila's last part:

import foo.bar;
pragma(msg, foo.bar.stringof); // "package bar"
import oops = foo.bar;
pragma(msg, oops.stringof);// "module bar"

which I think belongs to another bug report.

--


[Issue 17441] std.traits.moduleName gives wrong answer for modules imported under a different name in a mixin

2020-01-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17441

berni44  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from berni44  ---


*** This issue has been marked as a duplicate of issue 14501 ***

--


[Issue 17441] std.traits.moduleName gives wrong answer for modules imported under a different name in a mixin

2020-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17441

--- Comment #2 from berni44  ---
The problem is the call to packageName, not moduleName:

void main()
{
import std.traits : packageName;

import mod0 = foo.bar.baz;
import mod1 = foo.bar;

assert(packageName!mod0 == "foo.bar"); // comment this line out and it
works
assert(packageName!mod1 == "foo"); // fails with foo.bar
}

It seems, that the template `packageName` is only instantiated with the first
call. For the second, the template parameter seems to be considered the same as
before (although it isn't). DMD bug?

--


[Issue 17441] std.traits.moduleName gives wrong answer for modules imported under a different name in a mixin

2020-01-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17441

berni44  changed:

   What|Removed |Added

 CC||bugzi...@d-ecke.de
   Hardware|x86_64  |All
 OS|Linux   |All

--- Comment #1 from berni44  ---
Mixin seems not to matter. Simplified testcase (foo/bar/package.d and
foo/bar/baz.d like above):

void main()
{
import std.traits : moduleName;

import mod0 = foo.bar.baz;
import mod1 = foo.bar;

assert(moduleName!mod0 == "foo.bar.baz");
assert(moduleName!mod1 == "foo.bar"); // fails with foo.bar.bar
}

--