[Issue 20800] New: Error: cannot implicitly convert expression with bad diagnostic.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed May 6 13:27:12 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20800
Issue ID: 20800
Summary: Error: cannot implicitly convert expression with bad
diagnostic.
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: ibuclaw at gdcproject.org
```
struct RegexMatch
{
string index() { return null; }
~this() { }
}
static m() { return RegexMatch(); }
void initCommands()
{
auto a = new int[](m.index);
}
```
Yields the error:
Error: cannot implicitly convert expression ((RegexMatch __tmpfordtor3 = m();)
, __tmpfordtor3).index() of type string to ulong
The exposed lowering of m.index should not be there in the message.
--
More information about the Digitalmars-d-bugs
mailing list