Version: 3.0.11, bug present as of 3.0.10
Bug Description
If you use Container#getByType() inside of NEON configuration, it fails on resolving its return type – from Helpers#getReturnTypeAnnotation() it is returned Nette\DI\?T.
More generally, I believe (have not tried) accessing any class with method having generic return type will fail.
Steps To Reproduce
In nette/web-project, create this class:
namespace App;
final class FakeContainer
{
/**
* copied from Container#getByType()
* @template T
* @param class-string<T> $type
* @return ?T
*/
public function getService(string $type)
{
return null;
}
}
In services.neon, use it:
services:
- App\FakeContainer::getService(HomepagePresenter::class)

Expected Behavior
Run, not to fail with type check.