dmd/compiler/test/compilable/test13668.d
Nick Treleaven bb638373d6
Fix Issue 15436 - Compiler still refers to AliasSeq-s as "tuple"-s (#15363)
* 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
2023-06-30 11:02:00 +03:00

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);
}