Running Play on the Dotty compiler?

I am trying to run Play on Dotty following https://github.com/lampepfl/dotty-example-project. I am running into some issues (using the project from sbt new playframework/play-scala-seed.g8). Specifically, running sbt run yields a compileError:

play.sbt.PlayExceptions$UnexpectedException: Unexpected exception[The compilation failed without reporting any problem!]
	at play.sbt.run.PlayReload$.$anonfun$taskFailureHandler$3(PlayReload.scala:41)
	at scala.Option.getOrElse(Option.scala:189)
	at play.sbt.run.PlayReload$.$anonfun$taskFailureHandler$1(PlayReload.scala:41)
	at scala.Option.map(Option.scala:230)
	at play.sbt.run.PlayReload$.taskFailureHandler(PlayReload.scala:35)
	at play.sbt.run.PlayReload$.compileFailure(PlayReload.scala:28)
	at play.sbt.run.PlayReload$.$anonfun$compile$3(PlayReload.scala:63)
	at scala.util.Either$LeftProjection.map(Either.scala:573)
	at play.sbt.run.PlayReload$.compile(PlayReload.scala:63)
	at play.sbt.run.PlayRun$.$anonfun$playRunTask$4(PlayRun.scala:78)
Caused by: sbt.internal.inc.CompileFailed: null
	at sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:253)
	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:122)
	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:95)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:91)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:186)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3$adapted(MixedAnalyzingCompiler.scala:77)
	at sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:215)
	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:77)

Here is the compile error:

[error] -- [E100] Syntax Error:~/myapp/target/scala-0.26/routes/main/router/Routes.scala:56:21
[error] 56 |    HomeController_1.index,
[error]    |    ^^^^^^^^^^^^^^^^^^^^^^
[error]    |    method index must be called with () argument
[error] -- [E100] Syntax Error: ~/myapp/target/scala-0.26/routes/main/router/Routes.scala:93:72
[error] 93 |        controllers_HomeController_index0_invoker.call(HomeController_1.index)
[error]    |                                                       ^^^^^^^^^^^^^^^^^^^^^^
[error]    |                            method index must be called with () argument
[warn] 9 warnings found

I cleaned out the target folder and re-compiled but I still get the same error. I can’t fix the code as it’s the compiled stuff in the target folder. I have the implicit conversions compiler flag on. Any ideas on how to move forward, or if Play will work with Dotty out of the box soon?

Maybe the sird router does not have this issue?

This needs a fix in Play’s route generator. There is nothing you can do right now.
I created https://github.com/playframework/playframework/issues/10364

1 Like

Thank you, I’ll be monitoring the issue.