[Issue 24883] New: Speculative template overload error escapes with `-preview=rvaluerefparam`
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 26 09:51:03 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24883
Issue ID: 24883
Summary: Speculative template overload error escapes with
`-preview=rvaluerefparam`
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P3
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dkorpel at live.nl
With -preview=rvaluerefparam, this raises an error:
```D
int toString(Writer)(ref Writer sink) => 3;
int toString(void delegate(scope const(char)[]) sink) => 4;
void put() {}
pragma(msg, toString(dst => put()));
```
```
onlineapp.d(1): Error: cannot have parameter of type `void`
4
```
The error from trying to instantiate toString with `Writer = void` should be
ignored since that overload isn't picked.
--
More information about the Digitalmars-d-bugs
mailing list