Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails in Scala 2.12.8 if one or more parameters have default values defined in the API trait #78

Open
rpiaggio opened this issue Jan 11, 2019 · 3 comments

Comments

@rpiaggio
Copy link

Example:

trait SomeEntityApi {
  def retrieve(limit: Option[Int], skip: Int): Future[Seq[Entity]]
}

works, while:

trait SomeEntityApi {
  def retrieve(limit: Option[Int] = None, skip: Int = 0): Future[Seq[Entity]]
}

fails with:

[warn] an unexpected type representation reached the compiler backend while compiling Application.scala: <error>. If possible, please file a bug on https://github.com/scala/bug/issues.
[error] Error while emitting Application.scala
[error] <error> (of class scala.reflect.internal.Types$ErrorType$)
[error] Error while emitting Application.scala
[error] assertion failed: ClassBType.info not yet assigned: Lcontrollers/Application$$anonfun$1;
[warn] one warning found
[error] two errors found
[error] (Compile / compileIncremental) Compilation failed

Note 1: What actually fails is the compilation of Router.route[EventApi](new EventService) (present in Application.scala in this case).

Note 2: Worked with Scala 2.12.6.

Thank you!

@nafg
Copy link

nafg commented Jan 29, 2019

I'm getting a similar error, except it persists even after I eliminated defaults:

[warn] an unexpected type representation reached the compiler backend while compiling AutowireServerLayer.scala: <error>. If possible, please file a bug on https://github.com/scala/bug/issues.
[error] Error while emitting AutowireServerLayer.scala
[error] <error> (of class scala.reflect.internal.Types$ErrorType$)
[error] Error while emitting AutowireServerLayer.scala
[error] assertion failed: ClassBType.info not yet assigned: Llrbcol/snippet/request/AutowireServerLayer;
[error] Error while emitting AutowireServerLayer.scala
[error] assertion failed: ClassBType.info not yet assigned: Llrbcol/snippet/request/AutowireServerLayer$AutowireServer$;
[error] Error while emitting AutowireServerLayer.scala
[error] assertion failed: ClassBType.info not yet assigned: Llrbcol/snippet/request/AutowireServerLayer$AutowireServer$$anonfun$routes$1;
[error] Error while emitting AutowireServerLayer.scala
[error] assertion failed: ClassBType.info not yet assigned: Llrbcol/snippet/request/AutowireServerLayer$AutowireServer$;
[error] Error while emitting AutowireServerLayer.scala
[error] assertion failed: ClassBType.info not yet assigned: Llrbcol/snippet/request/AutowireServerLayer$AutowireServer$;
[error] Error while emitting AutowireServerLayer.scala
[error] assertion failed: ClassBType.info not yet assigned: Llrbcol/snippet/request/AutowireServerLayer;

@urwithsumit
Copy link

Hi,
I am having the same issue.
How were you able to work around on this issue?

thanks.

@Ahnfelt
Copy link

Ahnfelt commented Mar 20, 2024

We get the same error on Scala 2.12.19.
We can also reproduce the error on 2.12.8 but not on 2.12.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants