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

Method clash for AnyVal #10082

Closed
scabug opened this issue Nov 30, 2016 · 3 comments
Closed

Method clash for AnyVal #10082

scabug opened this issue Nov 30, 2016 · 3 comments
Assignees

Comments

@scabug
Copy link

@scabug scabug commented Nov 30, 2016

It seems to be a variant of #8702

https://scalafiddle.io/sf/Qm1ynvP/13

case class A[T](private val v: AnyRef) extends AnyVal

class B[T, U] extends (T => A[U]) {
  override def apply(k: T): A[U] = ???
}

ScalaFiddle.scala:6: error: bridge generated for member method apply: (k: T)ScalaFiddle.A[U] in class B
which overrides method apply: (v1: T1)R in trait Function1
clashes with definition of the member itself;
both have erased type (v1: Object)Object
    override def apply(k: T): A[U] = ???
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 30, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10082?orig=1
Reporter: Flávio W. Brasil (fwbrasil)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 30, 2016

Flávio W. Brasil (fwbrasil) said:
Also happens on Scala 2.12.0

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Nov 30, 2016

@retronym said:
This is a known limitation of the encoding of value classes. Unfortunately the best we can do is issue the error here.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.