Why can TODO in controllers sometimes not be compiled in play2?

TODO convenient when using coding controllers:

 object Application extends Controller { def test = Action { TODO } } 

It's good. But this:

 def login = Action { implicit request => TODO } 

It will not compile, error message:

 type mismatch; found : play.api.mvc.Action[play.api.mvc.AnyContent] required: play.api.mvc.Result 

I need to remove the iplicit request part or use Ok("todo") , which is not convenient.

How to fix it or am I missing something?

+6
source share
1 answer

As Guillaume Bort said in the google group , this is actually an action, not a result. Therefore, we must use it as:

 def test = TODO 
+4
source

Source: https://habr.com/ru/post/910865/


All Articles