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
duplicate method name&signature with singleton type parameters over constant types #8323
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8323?orig=1 |
@retronym said: [[syntax trees at end of constructors]] // test1.scala
package <empty> {
object Test extends Object {
final <stable> <accessor> def a(): String("Bippy") = "Bippy";
final <stable> <accessor> def b(): String("Dingo") = "Dingo";
def f(x: String("Bippy")): String = "Bippy";
def f(x: String("Dingo")): String = "Dingo";
def main(args: Array[String]): Unit = ();
def <init>(): Test.type = {
Test.super.<init>();
()
}
}
} |
@retronym said: |
@retronym said: object Foo extends (() => Int) {
def apply(): Int = 1
final override val toString = "Foo";
def main(args: Array[String]): Unit = println(this)
} trait Node { // must be a trait
def isLeaf: Boolean = ???
}
object MyLeaf extends Node {
override final val isLeaf = true // must be override final val
// mixin erroneously generates two methods in the object: forwarder and the actual method
/** (un-mangled from a repl session)
object MyLeaf extends Object with Node {
def isLeaf(): Boolean = Node$class.isLeaf(MyLeaf.this);
final override <stable> <accessor> def isLeaf(): Boolean(true) = true;
*/
} |
@retronym said: |
@gkossakowski said: |
@retronym said: |
@milessabin said: |
@SethTisue said: |
Jeff Shaw (shawjef3) said: trait HasX {
val x = new AnyRef
}
object Bad0 extends HasX {
override object x extends AnyRef
def main(args: Array[String]): Unit = {
println(x)
}
} yields
|
Fixed in scala/scala#5310 |
The text was updated successfully, but these errors were encountered: