gcc/testsuite/gdc.test/compilable/rvalueref.d
raw| 1 | /* REQUIRED_ARGS: -preview=rvaluerefparam |
| 2 | */ |
| 3 | |
| 4 | struct AS |
| 5 | { |
| 6 | string get() @safe @nogc pure nothrow { return _s; } |
| 7 | alias get this; |
| 8 | @disable this(this); |
| 9 | string _s; |
| 10 | } |
| 11 | |
| 12 | void popFront(ref string) { } |
| 13 | static assert(!is(typeof((R r) => r.popFront))); |
| 14 | |
| 15 | // https://issues.dlang.org/show_bug.cgi?id=24883 |
| 16 | int toString(Writer)(ref Writer sink) => 3; |
| 17 | int toString(void delegate(scope const(char)[]) sink) => 4; |
| 18 | void put() {} |
| 19 | static assert(toString(dst => put()) == 4); |