D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5014 - is(T U == super) returns non-shared parent types for shared(T)
Summary: is(T U == super) returns non-shared parent types for shared(T)
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-07 15:16 UTC by Sean Kelly
Modified: 2024-12-13 17:53 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 Sean Kelly 2010-10-07 15:16:56 UTC
The following code:

    import std.stdio;
    import std.traits;

    template Bases(T)
    {
        static if(is(T U == super))
            alias U Bases;
        else
            static assert(false);
    }

    void main()
    {
        alias Bases!(shared(Exception)) bases;
        foreach(i, e; bases)
            writeln(bases[i].stringof);
    }

Prints "Throwable" when it should probably print "shared(Throwable)".
Comment 1 Johannes Loher 2018-05-05 12:37:30 UTC
Still happening in 2.080.0. The spec states that U should be a TypeSeq of base classes and interfaces of T.

What is the desired behaviour?

This also happens for other attributes like const, immutable, and inout.

std.traits.BaseTypeTuple has the same behaviour.
Comment 2 dlangBugzillaToGithub 2024-12-13 17:53:50 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18309

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB