mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
28 lines
558 B
D
28 lines
558 B
D
// https://issues.dlang.org/show_bug.cgi?id=13577
|
|
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail13577.d(27): Error: cannot implicitly convert tuple element of type `int[]` to variable `x` of type `immutable(int[])`
|
|
---
|
|
*/
|
|
|
|
struct Tuple(Types...)
|
|
{
|
|
Types items;
|
|
alias items this;
|
|
}
|
|
|
|
struct Range(T)
|
|
{
|
|
T[] arr;
|
|
alias ElemType = Tuple!(int, T);
|
|
ElemType front() { return typeof(return)(0, arr[0]); }
|
|
bool empty() { return false; }
|
|
void popFront() {}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
foreach (immutable i, immutable x; Range!(int[])()) {} // Error
|
|
}
|