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

Bridge method clash for some AnyVal #8702

Closed
scabug opened this issue Jul 2, 2014 · 2 comments
Closed

Bridge method clash for some AnyVal #8702

scabug opened this issue Jul 2, 2014 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jul 2, 2014

object Trait {
  class V[T](val i:Int) extends AnyVal
}
trait Trait {
  protected def foo: Trait.V[_]
}

class C extends Trait {
  override protected final def foo: Trait.V[String] = new Trait.V[String](0)
}
D:\Documents\AnyValBridge\AnyValBridge.scala:9: bridge generated for member method foo: ()Trait.V[String] in class C
which overrides method foo: ()Trait.V[_] in trait Trait
clashes with definition of the member itself;
both have erased type ()Int
  override protected final def foo: Trait.V[String] = new Trait.V[String](0)
                               ^
@scabug
Copy link
Author

scabug commented Jul 2, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8702?orig=1
Reporter: @Atry
Affected Versions: 2.10.4
Duplicates #6385

@scabug
Copy link
Author

scabug commented Jul 4, 2014

@retronym said:
Duplicate of #6385, fixed in 2.11.0.

% scalac-hash v2.10.4 sandbox/test.scala
sandbox/test.scala:9: error: bridge generated for member method foo: ()Trait.V[String] in class C
which overrides method foo: ()Trait.V[_] in trait Trait
clashes with definition of the member itself;
both have erased type ()Int
  override protected final def foo: Trait.V[String] = new Trait.V[String](0)
                               ^
one error found
% scalac-hash v2.11.0 sandbox/test.scala
%

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

No branches or pull requests

2 participants