Test if method overloading is working properly.
All checks were successful
The build was successful.
All checks were successful
The build was successful.
This commit is contained in:
parent
ed8dab7870
commit
6a74bf9e8b
16
tests/overloading_methods.aer
Normal file
16
tests/overloading_methods.aer
Normal 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
tests/overloading_methods.exp
Normal file
2
tests/overloading_methods.exp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Counting 2 floats: 4.3 + 5.7 = 10
|
||||||
|
Counting 2 integers: 6 + 4 = 10
|
Loading…
Reference in New Issue
Block a user