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
34 lines
622 B
D
34 lines
622 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/diag13884.d(14): Error: functions cannot return a sequence (use `std.typecons.Tuple`)
|
|
fail_compilation/diag13884.d(21): instantiated from here: `MapResult!((t) => t.tupleof, Foo[])`
|
|
fail_compilation/diag13884.d(14): instantiated from here: `map!(Foo[])`
|
|
---
|
|
*/
|
|
|
|
struct Foo { int x; }
|
|
|
|
void main()
|
|
{
|
|
[Foo(1)].map!(t => t.tupleof);
|
|
}
|
|
|
|
template map(fun...)
|
|
{
|
|
auto map(Range)(Range r)
|
|
{
|
|
return MapResult!(fun, Range)(r);
|
|
}
|
|
}
|
|
|
|
struct MapResult(alias fun, R)
|
|
{
|
|
R _input;
|
|
|
|
@property auto ref front()
|
|
{
|
|
return fun(_input[0]);
|
|
}
|
|
|
|
}
|