Reduced test compiled with: -preview=dip1021
---
void byCodeUnit()
{
struct ByCodeUnitImpl
{
auto opIndex(size_t ) {}
}
isRandomAccessRange!ByCodeUnitImpl;
}
enum isRandomAccessRange(R) = lvalueOf!R[1];
ref T lvalueOf(T)();
---
Going to make another reduction that works with -dip1000 but not -dip1021.
Comment #1 by ibuclaw — 2021-04-30T12:31:10Z
Reduced test that compiles with -preview=dip1000, but not dip1021.
---
@property deleteme()
{
char[] cache;
buildPath(cache);
}
char[] buildPath(char[][])
{
struct ByCodeUnitImpl
{
auto opIndex(size_t ) { }
}
assert(isRandomAccessRange!ByCodeUnitImpl);
return [];
}
char[] buildPath(C)(C[][] paths...)
{
return buildPath(paths);
}
enum isRandomAccessRange(R) = is(typeof(lvalueOf!R[1]));
ref T lvalueOf(T)();
---
Comment #2 by ibuclaw — 2021-04-30T12:32:30Z
(In reply to Iain Buclaw from comment #1)
> Reduced test that compiles with -preview=dip1000, but not dip1021.
Further reduced:
---
void buildPath(char[][])
{
struct ByCodeUnitImpl
{
auto opIndex(size_t ) { }
}
assert(isRandomAccessRange!ByCodeUnitImpl);
}
enum isRandomAccessRange(R) = is(typeof(lvalueOf!R[1]));
ref T lvalueOf(T)();
---