Browse Source

Test if method overloading is working properly.

pull/50/head
Rafal Kupiec 2 years ago
parent
commit
6a74bf9e8b
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 18 additions and 0 deletions
  1. +16
    -0
      tests/overloading_methods.aer
  2. +2
    -0
      tests/overloading_methods.exp

+ 16
- 0
tests/overloading_methods.aer View File

@ -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);
}
}

+ 2
- 0
tests/overloading_methods.exp View File

@ -0,0 +1,2 @@
Counting 2 floats: 4.3 + 5.7 = 10
Counting 2 integers: 6 + 4 = 10

Loading…
Cancel
Save