Bug 5014 – is(T U == super) returns non-shared parent types for shared(T)

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-10-07T15:16:56Z
Last change time
2024-12-13T17:53:50Z
Assigned to
No Owner
Creator
Sean Kelly
See also
http://d.puremagic.com/issues/show_bug.cgi?id=4858
Moved to GitHub: dmd#18309 →

Comments

Comment #0 by sean — 2010-10-07T15:16:56Z
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 by johannes.loher — 2018-05-05T12:37:30Z
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 by robert.schadek — 2024-12-13T17:53:50Z
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