Using object SomeController extends Controller in Play framework 2.5 instead
<p>We're in the progress of upgrading to play 2.5.5 from play 2.4.x. We have a 
pretty large amount of controllers that are objects, like so:</p>

<pre><code>object TranslationsController extends Controller { ... }
</code></pre>

<p>However, since switching to 2.5, we now get hundreds of errors like this 
(it's a pretty huge project):</p>

<pre><code>type TranslationsController is not a member of package controllers
</code></pre>

<p>Is there a way to still allow some/most our Controllers to be object and 
not class? I realize this has everything to do with dependency injection. 
But a pretty large percentage of the controllers, <em>has</em> no dependencies. </p>

<p>Of course, we could rewrite it like so just to make it compile: </p>

<pre><code>class TranslationsController @Inject () extends Controller { ... }
</code></pre>

<p>but that's really pointless?? An immutable class/object that takes no 
parameters, <em>should</em> be an object. It's like <code>case class None()</code> vs <code>case 
object None</code>. Of course the latter should be the preferred one in every case.</p>

<p>The big deal here is that we can't just string replace object->class 
either, because we have a lot (~1000) of tests that assumes these 
controllers to be objects. To make it work with class, we would have to 
rewrite all those tests to first do a <code>val controller = 
new TranslationsController</code>, first, which is a lot of work (and tons of 
boilerplate). </p>

<p>I would really appreciate if there was some way to still use object. Is 
there some syntax for it in the <code>.routes</code> files, or is there an easy 
workaround? I mean, once there are dependencies to these controllers, we'll 
make them classes, but to do that to 100 controllers in one go without any 
benefit is pretty painful.</p>