Fix bugzilla 24883 - Speculative template overload error escapes with -preview=rvaluerefparam

This commit is contained in:
Dennis Korpel 2024-11-26 11:39:54 +01:00 committed by The Dlang Bot
parent 347c883586
commit 1a44210ffb
2 changed files with 13 additions and 1 deletions

View file

@ -11,3 +11,9 @@ struct AS
void popFront(ref string) { }
static assert(!is(typeof((R r) => r.popFront)));
// https://issues.dlang.org/show_bug.cgi?id=24883
int toString(Writer)(ref Writer sink) => 3;
int toString(void delegate(scope const(char)[]) sink) => 4;
void put() {}
static assert(toString(dst => put()) == 4);