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

typer fails assertion on implicit AnyVal case class with companion object #6597

Closed
scabug opened this issue Oct 31, 2012 · 7 comments
Closed

typer fails assertion on implicit AnyVal case class with companion object #6597

scabug opened this issue Oct 31, 2012 · 7 comments

Comments

@scabug
Copy link

@scabug scabug commented Oct 31, 2012

object Test {

trait T extends Any

implicit case class A(value: Int) extends AnyVal with T

object A
}

Gives

[error] uncaught exception during compilation: java.lang.AssertionError
[trace] Stack trace suppressed: run 'last compile:compile' for the full output.
[error] (compile:compile) java.lang.AssertionError: assertion failed: List(object A, object A)
[error] Total time: 0 s, completed 31-Oct-2012 12:31:10

Instead of the expected error about combining implicit and case.

@scabug
Copy link
Author

@scabug scabug commented Oct 31, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6597?orig=1
Reporter: Alec Zorab (aleczorab)

Loading

@scabug
Copy link
Author

@scabug scabug commented Oct 31, 2012

@adriaanm said:

java.lang.AssertionError: assertion failed: List(object A, object A)
	at scala.Predef$.assert(Predef.scala:179)
	at scala.reflect.internal.Symbols$Symbol.suchThat(Symbols.scala:1640)
	at scala.reflect.internal.Symbols$ClassSymbol.companionModule0(Symbols.scala:2926)
	at scala.reflect.internal.Symbols$ClassSymbol.companionSymbol(Symbols.scala:2930)
	at scala.tools.nsc.typechecker.Namers$class.companionSymbolOf(Namers.scala:1579)
	at scala.tools.nsc.interpreter.ReplGlobal$$anon$1.companionSymbolOf(ReplGlobal.scala:24)
	at scala.tools.nsc.typechecker.Namers$Namer.templateSig(Namers.scala:884)
	at scala.tools.nsc.typechecker.Namers$Namer.classSig(Namers.scala:907)
	at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1289)
	at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1347)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:709)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:708)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:708)
	at scala.tools.nsc.typechecker.Namers$Namer$LogTransitions.apply(Namers.scala:1376)
	at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1385)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:708)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:707)
	at scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1496)
	at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1504)
	at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1494)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1217)
	at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1349)
	at scala.tools.nsc.typechecker.MethodSynthesis$MethodSynth$class.addDerivedTrees(MethodSynthesis.scala:230)
	at scala.tools.nsc.typechecker.Namers$Namer.addDerivedTrees(Namers.scala:55)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$29.apply(Typers.scala:1854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$29.apply(Typers.scala:1854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$rewrappingWrapperTrees$1.apply(Typers.scala:1792)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$rewrappingWrapperTrees$1.apply(Typers.scala:1789)
	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
	at scala.collection.immutable.List.foreach(List.scala:309)
	at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1854)

Loading

@scabug
Copy link
Author

@scabug scabug commented Oct 31, 2012

Loading

@scabug
Copy link
Author

@scabug scabug commented Oct 31, 2012

@adriaanm said:
it wasn't a value class issue, for the record

Loading

@scabug
Copy link
Author

@scabug scabug commented Oct 31, 2012

Alec Zorab (aleczorab) said:
Indeed. Label removed.

Loading

@scabug
Copy link
Author

@scabug scabug commented Nov 1, 2012

@adriaanm said:
scala/scala#1551 for 2.10.x

Loading

@scabug
Copy link
Author

@scabug scabug commented Dec 4, 2012

Loading

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

Successfully merging a pull request may close this issue.

None yet
2 participants