gcc/testsuite/gdc.test/compilable/test8509.d
raw| 1 | module test8509; |
| 2 | enum E : string { a = "hello", b = "world" } |
| 3 | struct S |
| 4 | { |
| 5 | E opBinary(string s : "~")(S s) { return E.a; } |
| 6 | E opBinary(string s : "~")(string s) { return E.a; } |
| 7 | } |
| 8 | |
| 9 | void main() |
| 10 | { |
| 11 | E e3 = S() ~ S(); |
| 12 | E e4 = S() ~ "a"; |
| 13 | assert(e3 == E.a); |
| 14 | assert(e4 == E.a); |
| 15 | } |