D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10032 - std.traits.moduleName abuse a compiler issue: (parent trait can't evaluate parent object for manifest constants).
Summary: std.traits.moduleName abuse a compiler issue: (parent trait can't evaluate pa...
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-05 10:59 UTC by Igor Stepanov
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Igor Stepanov 2013-05-05 10:59:50 UTC

    
Comment 1 berni44 2019-11-14 12:41:07 UTC
Can you explain this a little bit more?

There have now passed about 6 years and it looks to me like no problems appeared here...
Comment 2 basile-z 2019-11-14 23:31:24 UTC
There was a bug but it's fixed since 2.063,

the following code with "all compilers" on run.dlang.io confirms:

---
module no_bug_here;

import std.traits: moduleName;

struct S
{
    enum se = 8;
    static assert(moduleName!se == "no_bug_here");

    struct I
    {
        enum ise = 8;
        static assert(moduleName!ise == "no_bug_here");
    }
}

void main(string[] args)
{
    enum le = 8;
    static assert(moduleName!le == "no_bug_here");
}
---


> Up to      2.060  : Failure with output:
-----
/path/to/dmd/dmd2/linux/bin64/../../src/phobos/std/traits.d(198): Error: argument 8 has no parent
/path/to/dmd/dmd2/linux/bin64/../../src/phobos/std/traits.d(198): Error: argument false has no parent
/path/to/dmd/dmd2/linux/bin64/../../src/phobos/std/traits.d(198): Error: alias std.traits.moduleName!(false).moduleName recursive alias declaration
/path/to/dmd/dmd2/linux/bin64/../../src/phobos/std/traits.d(198): Error: template instance std.traits.moduleName!(false) error instantiating
onlineapp.d(8):        instantiated from here: moduleName!(8)
onlineapp.d(8): Error: template instance std.traits.moduleName!(8) error instantiating
-----

2.061   to 2.062  : Failure with output:
-----
/path/to/dmd/dmd2/linux/bin64/../../src/phobos/std/traits.d(214): Error: argument 8 has no parent
/path/to/dmd/dmd2/linux/bin64/../../src/phobos/std/traits.d(214): Error: argument false has no parent
/path/to/dmd/dmd2/linux/bin64/../../src/phobos/std/traits.d(214): Error: alias std.traits.moduleName!(false).moduleName recursive alias declaration
/path/to/dmd/dmd2/linux/bin64/../../src/phobos/std/traits.d(214): Error: template instance std.traits.moduleName!(false) error instantiating
onlineapp.d(8):        instantiated from here: moduleName!(8)
onlineapp.d(8): Error: template instance std.traits.moduleName!(8) error instantiating
-----

Since      2.063  : Success and no output