Skip to content

Assertion failed: Int & Object with Serializable #9310

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
sir-wabbit opened this issue Jul 7, 2020 · 0 comments · Fixed by #9316
Closed

Assertion failed: Int & Object with Serializable #9310

sir-wabbit opened this issue Jul 7, 2020 · 0 comments · Fixed by #9316

Comments

@sir-wabbit
Copy link

sir-wabbit commented Jul 7, 2020

Minimized code

// AE-d101cfe6d25117a51897609e673f6c8e74d31e6e
val foo @ this = 0
class Foo {
  foo { }
}

Output (click arrow to expand)

exception occurred while typechecking test.scala
exception occurred while compiling test.scala
java.lang.AssertionError: assertion failed: Int & Object with Serializable {...} / TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int) & ClassInfo(ThisType(TypeRef(NoPrefix,module class <empty>)), module class test$package$, List(TypeRef(ThisType(TypeRef(NoPrefix,module class lang)),class Object), TypeRef(ThisType(TypeRef(NoPrefix,module class io)),trait Serializable))) while compiling test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: Int & Object with Serializable {...} / TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Int) & ClassInfo(ThisType(TypeRef(NoPrefix,module class <empty>)), module class test$package$, List(TypeRef(ThisType(TypeRef(NoPrefix,module class lang)),class Object), TypeRef(ThisType(TypeRef(NoPrefix,module class io)),trait Serializable)))
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
	at dotty.tools.dotc.core.Types$AndType$.apply(Types.scala:2912)
	at dotty.tools.dotc.core.Types$AndType$.make(Types.scala:2931)
	at dotty.tools.dotc.core.Types$AndType.derivedAndType(Types.scala:2894)
	at dotty.tools.dotc.core.Types$TypeMap.derivedAndType(Types.scala:4896)
	at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5005)
	at dotty.tools.dotc.typer.ImplicitRunInfo$liftToAnchors$1$.apply(Implicits.scala:706)
	at dotty.tools.dotc.typer.ProtoTypes$ViewProto.map(ProtoTypes.scala:431)
	at dotty.tools.dotc.typer.ProtoTypes$ViewProto.map(ProtoTypes.scala:431)
	at dotty.tools.dotc.core.Types$TypeMap.mapOver(Types.scala:5030)
	at dotty.tools.dotc.typer.ImplicitRunInfo$liftToAnchors$1$.apply(Implicits.scala:706)
	at dotty.tools.dotc.typer.ImplicitRunInfo.implicitScope$$anonfun$1(Implicits.scala:711)
	at scala.collection.mutable.AnyRefMap.getOrElse(AnyRefMap.scala:155)
	at dotty.tools.dotc.typer.ImplicitRunInfo.implicitScope(Implicits.scala:719)
	at dotty.tools.dotc.Run.implicitScope(Run.scala:32)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.implicitScope(Implicits.scala:1340)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1316)
	at dotty.tools.dotc.typer.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1325)
	at dotty.tools.dotc.typer.Implicits.op$1(Implicits.scala:979)
	at dotty.tools.dotc.typer.Implicits.inferImplicit(Implicits.scala:1015)
	at dotty.tools.dotc.typer.Typer.inferImplicit(Typer.scala:89)
	at dotty.tools.dotc.typer.Implicits.inferView(Implicits.scala:763)
	at dotty.tools.dotc.typer.Typer.inferView(Typer.scala:89)
	at dotty.tools.dotc.typer.Typer.adaptToSubType$1(Typer.scala:3437)
	at dotty.tools.dotc.typer.Typer.adaptNoArgsOther$4(Typer.scala:3233)
	at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:3295)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3526)
	at dotty.tools.dotc.typer.Typer.op$3(Typer.scala:2850)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2851)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2513)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2522)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2525)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2639)
	at dotty.tools.dotc.typer.Typer.typeSelectOnTerm$1(Typer.scala:555)
	at dotty.tools.dotc.typer.Typer.typedSelect(Typer.scala:579)
	at dotty.tools.dotc.typer.Typer.tryApply$1(Typer.scala:2760)
	at dotty.tools.dotc.typer.Typer.tryInsertApplyOrImplicit$$anonfun$2(Typer.scala:2782)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:2647)
	at dotty.tools.dotc.typer.Typer.tryInsertApplyOrImplicit(Typer.scala:2791)
	at dotty.tools.dotc.typer.Typer.adaptToArgs$1(Typer.scala:2977)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3518)
	at dotty.tools.dotc.typer.Typer.op$3(Typer.scala:2850)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2851)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2513)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2522)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2525)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2639)
	at dotty.tools.dotc.typer.Applications.typedFunPart$$anonfun$1(Applications.scala:843)
	at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:2647)
	at dotty.tools.dotc.typer.Applications.typedFunPart(Applications.scala:852)
	at dotty.tools.dotc.typer.Typer.typedFunPart(Typer.scala:89)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:864)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:999)
	at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:89)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2387)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2447)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2513)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2522)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2525)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2573)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2595)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2045)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2375)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2379)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2446)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2513)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2522)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2525)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2547)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2595)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2171)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2419)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2447)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2513)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2522)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2525)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2639)
	at dotty.tools.dotc.typer.FrontEnd.liftedTree1$1(FrontEnd.scala:79)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:84)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:42)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:85)
	at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:114)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:114)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:180)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
	at dotty.tools.dotc.Run.runPhases$5(Run.scala:190)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:198)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:64)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:205)
	at dotty.tools.dotc.Run.compileSources(Run.scala:142)
	at dotty.tools.dotc.Run.compile(Run.scala:124)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:38)
	at dotty.tools.dotc.Driver.process(Driver.scala:194)
	at dotty.tools.dotc.Driver.process(Driver.scala:163)
	at dotty.tools.dotc.Driver.process(Driver.scala:175)
	at dotty.tools.dotc.Driver.main(Driver.scala:202)
	at dotty.tools.dotc.Main.main(Main.scala)
odersky added a commit to dotty-staging/dotty that referenced this issue Jul 8, 2020
@nicolasstucki nicolasstucki linked a pull request Jul 8, 2020 that will close this issue
odersky added a commit that referenced this issue Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants