dmd/compiler/test/compilable/test17373.d
Nick Treleaven bb638373d6
Fix Issue 15436 - Compiler still refers to AliasSeq-s as "tuple"-s (#15363)
* Fix Issue 15436 - Compiler still refers to AliasSeq-s as "tuple"-s

Replace "tuple type" with "type sequence".
Replace "tuple" with "sequence".
Pretty print `AliasSeq!(args)`, not `tuple(args)`.
Leave json as "tuple" for now.
Also mention std.typecons.Tuple when trying to return a sequence.

Note: This does not rename any internal compiler symbols.

* Update runnable tests

* Update stringof tests

* Update remaining tests

* retrigger tests
2023-06-30 11:02:00 +03:00

32 lines
1.1 KiB
D

// https://issues.dlang.org/show_bug.cgi?id=17373
interface Foo { void visit (int); }
interface Bar { void visit(double); }
interface FooBar : Foo, Bar {}
static assert(__traits(getOverloads, FooBar, "visit").length == 2);
interface Fbar { void visit(char); void visit(double); }
interface Triple : Foo, Bar, Fbar {}
static assert(__traits(getOverloads, Triple, "visit").length == 3);
interface InheritanceMadness : FooBar, Triple {}
static assert(__traits(getOverloads, Triple, "visit").length == 3);
interface Simple
{
int square(int);
real square(real);
}
static assert(__traits(getOverloads, Simple, "square").length == 2);
// https://issues.dlang.org/show_bug.cgi?id=19064
interface InputStream {}
interface OutputStream{}
interface Stream : InputStream, OutputStream{}
interface ConnectionStream : Stream
{
@property bool connected() const;
void close();
}
static assert(__traits(getOverloads, ConnectionStream, "connected").stringof == "AliasSeq!(connected)");
static assert(__traits(getOverloads, ConnectionStream, "close").stringof == "AliasSeq!(close)");