diff --git a/tests/overloading_constructor.aer b/tests/overloading_constructor.aer new file mode 100644 index 0000000..fa45f28 --- /dev/null +++ b/tests/overloading_constructor.aer @@ -0,0 +1,18 @@ +class Test { + object __construct(string $a) { + print("$a\n"); + } + + object __construct(int $a, int $b) { + print("$a + $b = ", $a + $b, "\n"); + } + +} + +class Program { + void main() { + object $a, $b; + $a = new Test('Hello world!'); + $b = new Test(4, 7); + } +} diff --git a/tests/overloading_constructor.exp b/tests/overloading_constructor.exp new file mode 100644 index 0000000..7305267 --- /dev/null +++ b/tests/overloading_constructor.exp @@ -0,0 +1,2 @@ +Hello world! +4 + 7 = 11 \ No newline at end of file