[Issue 21682] New: checkaction=context fails for expressions using static operator overloads
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Mar 6 15:52:01 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21682
Issue ID: 21682
Summary: checkaction=context fails for expressions using static
operator overloads
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: moonlightsentinel at disroot.org
E.g. reduced example taken from std.process.environment:
============================================================================
class environment {
static bool opBinaryRight(string op : "in")(scope const(char)[] name)
{
return false;
}
}
void main()
{
assert("Hello" in environment);
}
=============================================================================
Error: cannot pass type environment as a function argument.
The problem here is that dmd tries to pass a TypeExp (environment) as a
parameter to _d_assert_fail.
--
More information about the Digitalmars-d-bugs
mailing list