mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

* Fix Issue 15436 - Compiler still refers to AliasSeq-s as "tuple"-s Replace "tuple type" with "type sequence". Replace "tuple" with "sequence". Pretty print `AliasSeq!(args)`, not `tuple(args)`. Leave json as "tuple" for now. Also mention std.typecons.Tuple when trying to return a sequence. Note: This does not rename any internal compiler symbols. * Update runnable tests * Update stringof tests * Update remaining tests * retrigger tests
38 lines
760 B
D
38 lines
760 B
D
// REQUIRED_ARGS: -o-
|
|
// PERMUTE_ARGS:
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
AliasSeq!("id", "toString", "toHash", "opCmp", "opEquals", "Monitor", "factory")
|
|
genProps
|
|
---
|
|
*/
|
|
|
|
class User : Entity!User
|
|
{
|
|
int id;
|
|
}
|
|
|
|
class Entity(T)
|
|
{
|
|
pragma(msg, generateProperties!T);
|
|
/* Compiler runs pragma(msg) in semantic() phase, but it does not insert any members
|
|
* in this class. Therefore getting __traits(allMembers, User) while evaluating
|
|
* generateProperties!User should work.
|
|
*/
|
|
}
|
|
|
|
template generateProperties(alias To)
|
|
{
|
|
string getProperties(alias Ta)()
|
|
{
|
|
string toRet = "genProps";
|
|
|
|
// This line is bad
|
|
pragma(msg, __traits(allMembers, Ta));
|
|
|
|
return toRet;
|
|
}
|
|
|
|
enum generateProperties = getProperties!(To);
|
|
}
|