mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 11:56:12 +03:00
22 lines
326 B
D
22 lines
326 B
D
// RUN: %ldc -run %s
|
|
|
|
interface Stream
|
|
{
|
|
void write(...);
|
|
}
|
|
|
|
class OutputStream : Stream
|
|
{
|
|
void write(...)
|
|
{
|
|
import core.vararg;
|
|
auto arg = va_arg!string(_argptr);
|
|
assert(arg == "Hello world");
|
|
}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
Stream stream = new OutputStream;
|
|
stream.write("Hello world");
|
|
}
|