<?hh //strict
foreach ($list as $id) {
$items = new DestinationsByCountry($id);
$remapped = $items->byKey('destination_id')->map($stringed ==> (int) $stringed);
$this->ids->addAll($remapped);
}
foreach ($list as $id) {
$this->ids->addAll(
// ******* error line below *******
new DestinationsByCountry($id)
->byKey('destination_id')
->map($stringed ==> (int) $stringed)
);
}
两者都适用于类型检查器,但第二个导致致命错误
致命错误:语法错误,意外的 T_OBJECT_OPERATOR,期待 ')'