lihaoyi/autowire

Can omission of .call() result in compile error

longshorej opened this issue · 3 comments

Hopefully this makes sense. If I'm doing anything stupid please let me know : )

I'm wondering if there's any way to have call() be required to compile. I've had a couple occasions already during development where I forgot to call it and finding out why ScalaJS blew up was fairly difficult.

trait MyApi {
  def now(): Future[Long]
}

val client = new Client(...)[MyApi]

client.now().call() map (l => println("Res: " + l))
client.now() map (l => println("Res: " + l)) // Any ideas on how to make this fail to compile?

Ah, yeah, it used to, but I removed the check to make it cross-compile to 2.10; I bet there's a solution to bring back the @compileTimeOnly definition while still giving 2.10 support...

This has happened

Nice! Thanks!