Typehinting merge #50

已合并
belliash 2019-04-17 11:27:52 +02:00 将 298 次代码提交从 typehinting合并至 master
修改 2 个文件,包含 46 行新增0 行删除
仅显示提交 bda8316e1b 的更改 - 显示所有提交

42
tests/interface_test.aer 普通文件
查看文件

@@ -0,0 +1,42 @@
interface iVehicle {
public void drive();
public void stop();
}
class Car implements iVehicle {
public void drive() {
print("Driving...\n");
}
public void stop() {
print("Stopping...\n");
}
}
class MyCar extends Car {
public void drive() {
print("Driving my car...\n");
}
}
class Program {
public void driveCar(iVehicle $vehicle) {
$vehicle->drive();
$vehicle->stop();
}
public void main() {
object $car = new Car();
object $mycar = new MyCar();
$this->driveCar($car);
$this->driveCar($mycar);
}
}

4
tests/interface_test.exp 普通文件
查看文件

@@ -0,0 +1,4 @@
Driving...
Stopping...
Driving my car...
Stopping...