Debian Codegraph @

gcc/testsuite/gdc.test/compilable/test20795.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=20795
2
3 // REQUIRED_ARGS: -preview=dip1000
4
5 struct Foo
6 {
7 void opEquals(T)(T rhs) if (T.init.opCast!string) {}
8 }
9
10 struct Bar
11 {
12 void opEquals()(Bar)
13 {
14 Gun() == Foo();
15 }
16 }
17
18 class Baz
19 {
20 void opCast(T)() {}
21 }
22
23 struct Gun
24 {
25 void[24] buff;
26
27 auto underlying()
28 {
29 return cast(Baz) buff.ptr;
30 }
31
32 alias underlying this;
33
34 void opEquals(R)(R) if (Bar.init == R.init) {}
35 }