Hey Rob & all,
One objection, one question.
The objection is to `include types 'types.php'`. You've clarified why types
cannot be autoloaded (thanks again!) and so this is a way to let the compiler
know where the types are. But I have to say I've spent a huge part of my career
removing include/require when refactoring legacy code, and introducing it here
causes me great heartache.
The question is a little more complicated, and also involves autoloading. Given
a class Number that can be autoloaded ...
namespace Foo;
class Number { /* ... */ }
... and *another* class in the same namespace, that creates a "number" type
alias...
namespace Foo;
use type int|float as Number;
class Bar { public function add(Number $a, Number $b) : Number { /* ...
*/ }
... which one "wins" -- the runtime autoloaded class, or the compile-time type
alias?
(Apologies if this is covered in the RFC and I missed it.)
-- pmj