Optional makes sure that only an injection happens if the corresponding key is already in the container. So in your case the autoinject would eagerly resolve and the default param is useless
So, just for my own clarity, and restating it to make sure I have it right.
The container is the Aurelia default DI container. @optional will only use an existing DI container object, and would not instantiate a new one. @autoinject would have replaced any default constructor parameter values and they would never be seen. So if you actually wanted some default values, you would not want to use @autoinject.
How does that work in Aurelia 2 with its constructor having DI without using @autoinject?
Note The secret of TypeScript’s metadata generation is that any decorator on the class will cause the compiler to include the metadata. You don’t have to use the inject decorator specifically.
In v2 it should behave similarly with same drawbacks of no resolvers in this case. There are new benefits of being able to use Interfaces as keys though, through use of declaration merges with Symbols, which in itself is really a killer feature