| 1 |
// https://issues.dlang.org/show_bug.cgi?id=21850 |
| 2 |
|
| 3 |
struct Strukt2 { |
| 4 |
this(int* _block) { } |
| 5 |
} |
| 6 |
|
| 7 |
struct Strukt { |
| 8 |
int* block; |
| 9 |
Strukt2 foo() { return Strukt2(null); } |
| 10 |
alias foo this; |
| 11 |
} |
| 12 |
|
| 13 |
bool wrapper(T)(ref T a, ref T b) |
| 14 |
{ |
| 15 |
return doesPointTo(a, b); |
| 16 |
} |
| 17 |
|
| 18 |
void johan() pure { |
| 19 |
Strukt a; |
| 20 |
Strukt b; |
| 21 |
assert(wrapper(a, b)); // error wrapper is not pure |
| 22 |
assert(doesPointTo(a, b)); // fine |
| 23 |
} |
| 24 |
|
| 25 |
bool doesPointTo(S, T)(S , T) { |
| 26 |
return false; |
| 27 |
} |
| 28 |
|
| 29 |
bool doesPointTo(S)(shared S) { |
| 30 |
return false; |
| 31 |
} |
| 32 |
|
| 33 |
bool mayPointTo(){ |
| 34 |
return false; |
| 35 |
} |