| 1 |
// https://issues.dlang.org/show_bug.cgi?id=17373 |
| 2 |
interface Foo { void visit (int); } |
| 3 |
interface Bar { void visit(double); } |
| 4 |
interface FooBar : Foo, Bar {} |
| 5 |
static assert(__traits(getOverloads, FooBar, "visit").length == 2); |
| 6 |
|
| 7 |
interface Fbar { void visit(char); void visit(double); } |
| 8 |
interface Triple : Foo, Bar, Fbar {} |
| 9 |
static assert(__traits(getOverloads, Triple, "visit").length == 3); |
| 10 |
|
| 11 |
interface InheritanceMadness : FooBar, Triple {} |
| 12 |
static assert(__traits(getOverloads, Triple, "visit").length == 3); |
| 13 |
|
| 14 |
interface Simple |
| 15 |
{ |
| 16 |
int square(int); |
| 17 |
real square(real); |
| 18 |
} |
| 19 |
static assert(__traits(getOverloads, Simple, "square").length == 2); |
| 20 |
|
| 21 |
// https://issues.dlang.org/show_bug.cgi?id=19064 |
| 22 |
interface InputStream {} |
| 23 |
interface OutputStream{} |
| 24 |
interface Stream : InputStream, OutputStream{} |
| 25 |
interface ConnectionStream : Stream |
| 26 |
{ |
| 27 |
@property bool connected() const; |
| 28 |
void close(); |
| 29 |
} |
| 30 |
|
| 31 |
static assert(__traits(getOverloads, ConnectionStream, "connected").stringof == "AliasSeq!(connected)"); |
| 32 |
static assert(__traits(getOverloads, ConnectionStream, "close").stringof == "AliasSeq!(close)"); |