mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
25 lines
367 B
D
25 lines
367 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail15.d(24): Error: cannot use `[]` operator on expression of type `void`
|
|
---
|
|
*/
|
|
/*
|
|
Segfault on DMD 0.095
|
|
https://www.digitalmars.com/d/archives/digitalmars/D/bugs/926.html
|
|
*/
|
|
module test;
|
|
|
|
template Test()
|
|
{
|
|
bool opIndex(bool x)
|
|
{
|
|
return !x;
|
|
}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
mixin Test!() xs;
|
|
bool x = xs[false];
|
|
}
|