Skip to content

assertion failure when method defined twice #2779

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

Closed
scabug opened this issue Dec 9, 2009 · 3 comments
Closed

assertion failure when method defined twice #2779

scabug opened this issue Dec 9, 2009 · 3 comments
Assignees

Comments

@scabug
Copy link

scabug commented Dec 9, 2009

abstract class M
{
    def f: List[M] = Nil
}

object M1 extends M

object M2 extends M
{
    override def f = List(M1)
}

object M3 extends M
{
    override def f = List(M1)
    override def f = List(M1)
}

object M4 extends M
{
    override def f = List(
        M3,
        M2
    )
}
error: method f is defined twice
    override def f = List(M1)
                 ^
Exception in thread "main" java.lang.AssertionError: assertion failed: List(method f, method f)
	at scala.tools.nsc.symtab.Symbols$$Symbol.suchThat(Symbols.scala:1061)
	at scala.tools.nsc.symtab.Types$$$$anonfun$$32.apply(Types.scala:4546)
	at scala.tools.nsc.symtab.Types$$$$anonfun$$32.apply(Types.scala:4545)
	at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:240)
	at scala.collection.TraversableLike$$$$anonfun$$map$$1.apply(TraversableLike.scala:240)
	at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:88)
	at scala.collection.immutable.List.foreach(List.scala:45)
	at scala.collection.TraversableLike$$class.map(TraversableLike.scala:240)
	at scala.collection.immutable.List.map(List.scala:45)
	at scala.tools.nsc.symtab.Types$$class.lubsym$$1(Types.scala:4545)
	at scala.tools.nsc.symtab.Types$$$$anonfun$$34.apply(Types.scala:4576)
	at scala.tools.nsc.symtab.Types$$$$anonfun$$34.apply(Types.scala:4571)
	at scala.collection.LinearSeqLike$$class.foreach(LinearSeqLike.scala:88)
	at scala.collection.immutable.List.foreach(List.scala:45)
	at scala.tools.nsc.symtab.Types$$class.lub0$$1(Types.scala:4571)
	at scala.tools.nsc.symtab.Types$$class.lub(Types.scala:4595)
	at scala.tools.nsc.symtab.SymbolTable.lub(SymbolTable.scala:13)
	at scala.tools.nsc.symtab.Types$$class.solveOne$$1(Types.scala:4342)
...
@scabug
Copy link
Author

scabug commented Dec 9, 2009

Imported From: https://issues.scala-lang.org/browse/SI-2779?orig=1
Reporter: Eric Willigers (ewilligers)

@scabug
Copy link
Author

scabug commented Dec 10, 2009

@hubertp said:
Throws assertion in r20082 and 2.7.7.

@scabug
Copy link
Author

scabug commented Dec 18, 2009

@odersky said:
(In r20230) Closed #2779. review by community.

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

2 participants