Problem with code assist for arrays [message #1393128] |
Thu, 03 July 2014 05:26  |
Eclipse User |
|
|
|
I am a bit puzzled with array hinting for code assist. Consider this synthetic example :
class foo {
public $value;
}
class bar {
public $foos;
/**
* @return foo[]
*/
public function getHintedFoos(){
return $this->foo;
}
public function getUnhintedFoos(){
return $this->foo;
}
}
$obj_bar = new bar();
$obj_bar->getHintedFoos()[0]-> // WORKS: code assist uses @return as hint
$obj_bar->getUnhintedFoos()[0]-> // DOES NOT WORK, OBVIOUSLY: code assist has no clue what is returned
/* @var $single_foo foo */
$single_foo = $obj_bar->getUnhintedFoos();
$single_foo-> // WORKS: code assist uses @var as hint
/* @var $array_foos foo[] */
$array_foos = $obj_bar->getUnhintedFoos();
$array_foos[0]-> // DOES NOT WORK, WHY???
Is there a bug in PDT (3.3.0.201406110111) or are my hints in wrong syntax?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.29824 seconds