mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
35 lines
460 B
D
35 lines
460 B
D
// https://issues.dlang.org/show_bug.cgi?id=20795
|
|
|
|
// REQUIRED_ARGS: -preview=dip1000
|
|
|
|
struct Foo
|
|
{
|
|
void opEquals(T)(T rhs) if (T.init.opCast!string) {}
|
|
}
|
|
|
|
struct Bar
|
|
{
|
|
void opEquals()(Bar)
|
|
{
|
|
Gun() == Foo();
|
|
}
|
|
}
|
|
|
|
class Baz
|
|
{
|
|
void opCast(T)() {}
|
|
}
|
|
|
|
struct Gun
|
|
{
|
|
void[24] buff;
|
|
|
|
auto underlying()
|
|
{
|
|
return cast(Baz) buff.ptr;
|
|
}
|
|
|
|
alias underlying this;
|
|
|
|
void opEquals(R)(R) if (Bar.init == R.init) {}
|
|
}
|