[Issue 20863] Passing aggregate types into templates by alias drops qualifier
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue May 26 07:45:33 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20863
uplink.coder at googlemail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |uplink.coder at googlemail.com
Summary|Pass into template by alias |Passing aggregate types
|drops qualifier |into templates by alias
| |drops qualifier
--- Comment #5 from uplink.coder at googlemail.com ---
The issue is not quite correct
struct Foo {}
template P(alias X)
{
pragma(msg, X);
enum P = 1;
}
int y = P!(const int);
int x = P!(immutable(double));
int z = P!(immutable(Foo));
int z2 = P!(immutable Foo);
The output of this is
const(int)
immutable(double)
Foo
What happens is that the types which are not symbols are merely "losslessly
cast" to a symbol.
Therefore the STC is not dropped
--
More information about the Digitalmars-d-bugs
mailing list