diff --git a/tests/overloading_methods.aer b/tests/overloading_methods.aer new file mode 100644 index 0000000..cc45c09 --- /dev/null +++ b/tests/overloading_methods.aer @@ -0,0 +1,16 @@ +class Program { + + function count(int $a, int $b) { + print("Counting 2 integers: $a + $b = ", $a + $b, "\n"); + } + + function count(float $a, float $b) { + print("Counting 2 floats: $a + $b = ", $a + $b, "\n"); + } + + function main() { + $this->count(4.3, 5.7); + $this->count(6, 4); + } + +} diff --git a/tests/overloading_methods.exp b/tests/overloading_methods.exp new file mode 100644 index 0000000..bfc9055 --- /dev/null +++ b/tests/overloading_methods.exp @@ -0,0 +1,2 @@ +Counting 2 floats: 4.3 + 5.7 = 10 +Counting 2 integers: 6 + 4 = 10