Skip to content

Make dotty compile backend. #543

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

Merged
merged 16 commits into from
May 9, 2015
Merged

Conversation

DarkDimius
Copy link
Contributor

Changes that make dotty one step closer to bootstrap.
And a fix to Pattern matcher revealed by backend.

@DarkDimius
Copy link
Contributor Author

Currently fails at erasure with

./src/dotty/tools/backend/jvm/GenBCode.scala:215: warning: cannot merge class PrefixSetting in class MutableSettings with type bounds <: ScalaSettings.super.Setting{T = scala.collection.immutable.List[String]} as members of one type; keeping only class PrefixSetting in class MutableSettings
      lazy val localOpt = new LocalOpt(new Settings())
                              ^
findMember exception for TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing), AndType(RefinedType(TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,settings)),ScalaSettings)),EnableSettings), scala$tools$nsc$settings$MutableSettings$EnableSettings$$T, TypeAlias(TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,settings)),ScalaSettings)),BooleanSetting)) | -1632041102),TypeRef(ThisType(TypeRef(NoPrefix,scala)),Singleton))) member scala$tools$nsc$settings$MutableSettings$EnableSettings$$T
findMember exception for TypeRef(NoPrefix,_1103.type) member scala$tools$nsc$settings$MutableSettings$EnableSettings$$T
findMember exception for TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,scala)),Nothing), AndType(RefinedType(TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,settings)),ScalaSettings)),EnableSettings), scala$tools$nsc$settings$MutableSettings$EnableSettings$$T, TypeAlias(TypeRef(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,settings)),ScalaSettings)),BooleanSetting)) | -1632041102),TypeRef(ThisType(TypeRef(NoPrefix,scala)),Singleton))) member scala$tools$nsc$settings$MutableSettings$EnableSettings$$T
findMember exception for TypeRef(NoPrefix,_1103.type) member scala$tools$nsc$settings$MutableSettings$EnableSettings$$T
exception while typing new tools.nsc.backend.jvm.opt.LocalOpt(new tools.nsc.Settings()) of class class dotty.tools.dotc.ast.Trees$Apply # 1018023
exception while typing lazy <accessor> def localOpt: scala.tools.nsc.backend.jvm.opt.LocalOpt = new tools.nsc.backend.jvm.opt.LocalOpt(new tools.nsc.Settings()) of class class dotty.tools.dotc.ast.Trees$DefDef # 1315805
exception while typing class Worker2() extends Object() {
...
[error]     at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:600)
[error]     at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:383)
[error]     at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:1247)
[error]     at dotty.tools.dotc.core.Types$NamedType.denotAt(Types.scala:1224)
[error]     at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:1212)
[error]     at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:1384)
[error]     at dotty.tools.dotc.core.TypeApplications$.recur$2(TypeApplications.scala:395)
[error]     at dotty.tools.dotc.core.TypeApplications$.recur$2(TypeApplications.scala:402)
[error]     at dotty.tools.dotc.core.TypeApplications$.containsSkolemType$extension(TypeApplications.scala:410)
[error]     at dotty.tools.dotc.core.Types$RefinedType.refinementRefersToThis(Types.scala:1770)
[error]     at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:456)
[error]     at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:425)
[error]     at dotty.tools.dotc.core.Types$Type.goAnd$1(Types.scala:489)
[error]     at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:443)
[error]     at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:491)
[error]     at dotty.tools.dotc.core.Denotations$Denotation.findMember(Denotations.scala:166)
[error]     at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:429)
[error]     at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:491)
[error]     at dotty.tools.dotc.core.Types$Type$$anonfun$member$1.apply(Types.scala:407)
[error]     at dotty.tools.dotc.core.Types$Type$$anonfun$member$1.apply(Types.scala:407)
[error]     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
[error]     at dotty.tools.dotc.core.Types$Type.member(Types.scala:406)
[error]     at dotty.tools.dotc.core.Types$NamedType.asMemberOf(Types.scala:1355)
[error]     at dotty.tools.dotc.core.Types$NamedType.loadDenot(Types.scala:1343)
[error]     at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:1235)
[error]     at dotty.tools.dotc.core.Types$NamedType.denotAt(Types.scala:1224)
[error]     at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:1212)
[error]     at dotty.tools.dotc.core.Types$NamedType.symbol(Types.scala:1373)
[error]     at dotty.tools.dotc.printing.RefinedPrinter$$anonfun$toText$1.apply(RefinedPrinter.scala:125)
[error]     at dotty.tools.dotc.printing.RefinedPrinter$$anonfun$toText$1.apply(RefinedPrinter.scala:95)
[error]     at dotty.tools.dotc.printing.PlainPrinter.controlled(PlainPrinter.scala:22)
[error]     at dotty.tools.dotc.printing.RefinedPrinter.toText(RefinedPrinter.scala:95)
[error]     at dotty.tools.dotc.printing.RefinedPrinter$$anonfun$toText$1.apply(RefinedPrinter.scala:135)
[error]     at dotty.tools.dotc.printing.RefinedPrinter$$anonfun$toText$1.apply(RefinedPrinter.scala:95)
[error]     at dotty.tools.dotc.printing.PlainPrinter.controlled(PlainPrinter.scala:22)
[error]     at dotty.tools.dotc.printing.RefinedPrinter.toText(RefinedPrinter.scala:95)
[error]     at dotty.tools.dotc.core.Types$Type.toText(Types.scala:1025)
[error]     at dotty.tools.dotc.printing.Showable$class.show(Showable.scala:23)
[error]     at dotty.tools.dotc.core.Types$Type.show(Types.scala:73)
[error]     at dotty.tools.dotc.core.Denotations$SingleDenotation.signature(Denotations.scala:394)
[error]     at dotty.tools.dotc.core.Denotations$SingleDenotation.atSignature(Denotations.scala:421)
[error]     at dotty.tools.dotc.core.Types$TermRefWithSignature.loadDenot(Types.scala:1502)
[error]     at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:1235)
[error]     at dotty.tools.dotc.core.Types$NamedType.denotAt(Types.scala:1224)
[error]     at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:1212)
[error]     at dotty.tools.dotc.core.Types$NamedType.symbol(Types.scala:1373)
[error]     at dotty.tools.dotc.core.Substituters$class.subst1(Substituters.scala:31)
[error]     at dotty.tools.dotc.core.Contexts$Context.subst1(Contexts.scala:51)
[error]     at dotty.tools.dotc.core.Types$Type.subst(Types.scala:952)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.elimExistentials(Scala2Unpickler.scala:614)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readType(Scala2Unpickler.scala:717)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$$anonfun$readTypeRef$1.apply(Scala2Unpickler.scala:795)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$$anonfun$readTypeRef$1.apply(Scala2Unpickler.scala:795)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.atReadPos(Scala2Unpickler.scala:326)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.at(Scala2Unpickler.scala:316)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readTypeRef(Scala2Unpickler.scala:795)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.readType(Scala2Unpickler.scala:710)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$LocalUnpickler$$anonfun$9.apply(Scala2Unpickler.scala:537)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$LocalUnpickler$$anonfun$9.apply(Scala2Unpickler.scala:537)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.atReadPos(Scala2Unpickler.scala:326)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.at(Scala2Unpickler.scala:316)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$LocalUnpickler.dotty$tools$dotc$core$unpickleScala2$Scala2Unpickler$LocalUnpickler$$parseToCompletion$1(Scala2Unpickler.scala:537)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$LocalUnpickler$$anonfun$complete$1.apply$mcV$sp(Scala2Unpickler.scala:566)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$LocalUnpickler$$anonfun$complete$1.apply(Scala2Unpickler.scala:566)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$LocalUnpickler$$anonfun$complete$1.apply(Scala2Unpickler.scala:566)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.atReadPos(Scala2Unpickler.scala:326)
[error]     at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler$LocalUnpickler.complete(Scala2Unpickler.scala:566)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:161)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:143)
[error]     at dotty.tools.dotc.transform.TreeTransforms$AnnotationTransformer$class.transform(TreeTransform.scala:183)
[error]     at dotty.tools.dotc.transform.FirstTransform.transform(FirstTransform.scala:30)
[error]     at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:568)
[error]     at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:586)
[error]     at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:394)
[error]     at dotty.tools.dotc.core.Symbols$Symbol.isType(Symbols.scala:410)
[error]     at dotty.tools.dotc.core.TypeErasure$$anonfun$6.apply(TypeErasure.scala:354)
[error]     at dotty.tools.dotc.core.TypeErasure$$anonfun$6.apply(TypeErasure.scala:354)
[error]     at dotty.tools.dotc.core.Scopes$Scope$$anonfun$filteredScope$1.apply(Scopes.scala:133)
[error]     at dotty.tools.dotc.core.Scopes$Scope$$anonfun$filteredScope$1.apply(Scopes.scala:132)
[error]     at scala.collection.Iterator$class.foreach(Iterator.scala:750)
[error]     at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
[error]     at dotty.tools.dotc.core.Scopes$Scope.filteredScope(Scopes.scala:132)
[error]     at dotty.tools.dotc.core.TypeErasure.dotty$tools$dotc$core$TypeErasure$$apply(TypeErasure.scala:354)
[error]     at dotty.tools.dotc.core.TypeErasure.eraseInfo(TypeErasure.scala:385)
[error]     at dotty.tools.dotc.core.TypeErasure$.transformInfo(TypeErasure.scala:165)
[error]     at dotty.tools.dotc.transform.Erasure.transform(Erasure.scala:54)
[error]     at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:568)
[error]     at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:1239)
[error]     at dotty.tools.dotc.core.Types$NamedType.denotAt(Types.scala:1224)
[error]     at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:1212)
[error]     at dotty.tools.dotc.core.Types$NamedType.symbol(Types.scala:1373)
[error]     at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:156)
[error]     at dotty.tools.dotc.core.TypeComparer.dotty$tools$dotc$core$TypeComparer$$firstTry(TypeComparer.scala:187)
[error]     at dotty.tools.dotc.core.TypeComparer$$anonfun$isSubType$1.apply$mcZ$sp(TypeComparer.scala:100)
[error]     at dotty.tools.dotc.core.TypeComparer$$anonfun$isSubType$1.apply(TypeComparer.scala:92)
[error]     at dotty.tools.dotc.core.TypeComparer$$anonfun$isSubType$1.apply(TypeComparer.scala:92)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:147)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:91)
[error]     at dotty.tools.dotc.core.TypeComparer.topLevelSubType(TypeComparer.scala:85)
[error]     at dotty.tools.dotc.core.Types$Type$$anonfun$$less$colon$less$1.apply$mcZ$sp(Types.scala:588)
[error]     at dotty.tools.dotc.core.Types$Type$$anonfun$$less$colon$less$1.apply(Types.scala:588)
[error]     at dotty.tools.dotc.core.Types$Type$$anonfun$$less$colon$less$1.apply(Types.scala:588)
[error]     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
[error]     at dotty.tools.dotc.core.Types$Type.$less$colon$less(Types.scala:587)
[error]     at dotty.tools.dotc.transform.Erasure$Boxing$.adaptToType(Erasure.scala:253)
[error]     at dotty.tools.dotc.transform.Erasure$Typer$$anonfun$adapt$2.apply(Erasure.scala:651)
[error]     at dotty.tools.dotc.transform.Erasure$Typer$$anonfun$adapt$2.apply(Erasure.scala:647)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:164)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:148)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.transform.Erasure$Typer.adapt(Erasure.scala:647)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1089)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1087)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:147)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1087)
[error]     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1126)
[error]     at dotty.tools.dotc.transform.Erasure$Typer$$anonfun$4.apply(Erasure.scala:435)
[error]     at dotty.tools.dotc.transform.Erasure$Typer$$anonfun$4.apply(Erasure.scala:435)
[error]     at dotty.tools.dotc.core.Decorators$ListDecorator$.zipWithConserve$extension(Decorators.scala:97)
[error]     at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:435)
[error]     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1039)
[error]     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1079)
[error]     at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:93)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1089)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1087)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:147)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1087)
[error]     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1126)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedDefDef$1.apply(Typer.scala:893)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedDefDef$1.apply(Typer.scala:886)
[error]     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
[error]     at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:886)
[error]     at dotty.tools.dotc.transform.Erasure$Typer.typedDefDef(Erasure.scala:481)
[error]     at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1027)
[error]     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1077)
[error]     at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:93)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1089)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1087)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:147)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1087)
[error]     at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1111)
[error]     at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1122)
[error]     at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:540)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedClassDef$1.apply(Typer.scala:923)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedClassDef$1.apply(Typer.scala:905)
[error]     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
[error]     at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:905)
[error]     at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1030)
[error]     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1077)
[error]     at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:93)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1089)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1087)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:147)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1087)
[error]     at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1111)
[error]     at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1122)
[error]     at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:540)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedClassDef$1.apply(Typer.scala:923)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedClassDef$1.apply(Typer.scala:905)
[error]     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
[error]     at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:905)
[error]     at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1030)
[error]     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1077)
[error]     at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:93)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1089)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1087)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:147)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1087)
[error]     at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1111)
[error]     at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1122)
[error]     at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:540)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:970)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:961)
[error]     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
[error]     at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:961)
[error]     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1067)
[error]     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1079)
[error]     at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:93)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1089)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1087)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:147)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1087)
[error]     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1126)
[error]     at dotty.tools.dotc.transform.Erasure.run(Erasure.scala:72)
[error]     at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:268)
[error]     at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:266)
[error]     at scala.collection.immutable.List.map(List.scala:277)
[error]     at dotty.tools.dotc.core.Phases$Phase$class.runOn(Phases.scala:266)
[error]     at dotty.tools.dotc.transform.Erasure.runOn(Erasure.scala:30)
[error]     at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:59)
[error]     at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:56)
[error]     at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
[error]     at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
[error]     at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply$mcV$sp(Run.scala:56)
[error]     at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:52)
[error]     at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:52)
[error]     at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:68)
[error]     at dotty.tools.dotc.Run.compileUnits(Run.scala:52)
[error]     at dotty.tools.dotc.Run.compileSources(Run.scala:49)
[error]     at dotty.tools.dotc.Run.compile(Run.scala:33)
[error]     at dotty.tools.dotc.Driver.doCompile(Driver.scala:20)
[error]     at dotty.tools.dotc.Bench$.dotty$tools$dotc$Bench$$super$doCompile(Bench.scala:38)
[error]     at dotty.tools.dotc.Bench$$anonfun$doCompile$1.apply(Bench.scala:38)
[error]     at dotty.tools.dotc.Bench$$anonfun$doCompile$1.apply(Bench.scala:36)
[error]     at dotty.tools.dotc.Bench$$anonfun$ntimes$1.apply(Bench.scala:30)
[error]     at dotty.tools.dotc.Bench$$anonfun$ntimes$1.apply(Bench.scala:30)
[error]     at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:142)
[error]     at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:142)
[error]     at scala.collection.immutable.Range.foreach(Range.scala:166)
[error]     at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:142)
[error]     at scala.collection.AbstractTraversable.foldLeft(Traversable.scala:104)
[error]     at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:136)
[error]     at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:104)
[error]     at dotty.tools.dotc.Bench$.ntimes(Bench.scala:30)
[error]     at dotty.tools.dotc.Bench$.doCompile(Bench.scala:36)
[error]     at dotty.tools.dotc.Driver.process(Driver.scala:31)
[error]     at dotty.tools.dotc.Bench$.dotty$tools$dotc$Bench$$super$process(Bench.scala:53)
[error]     at dotty.tools.dotc.Bench$$anonfun$process$1.apply(Bench.scala:53)
[error]     at dotty.tools.dotc.Bench$$anonfun$process$1.apply(Bench.scala:53)
[error]     at dotty.tools.dotc.Bench$$anonfun$ntimes$1.apply(Bench.scala:30)
[error]     at dotty.tools.dotc.Bench$$anonfun$ntimes$1.apply(Bench.scala:30)
[error]     at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:142)
[error]     at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:142)
[error]     at scala.collection.immutable.Range.foreach(Range.scala:166)
[error]     at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:142)
[error]     at scala.collection.AbstractTraversable.foldLeft(Traversable.scala:104)
[error]     at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:136)
[error]     at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:104)
[error]     at dotty.tools.dotc.Bench$.ntimes(Bench.scala:30)
[error]     at dotty.tools.dotc.Bench$.process(Bench.scala:53)
[error]     at test.CompilerTest.compileArgs(CompilerTest.scala:159)
[error]     at test.CompilerTest.compileDir(CompilerTest.scala:104)
[error]     at dotc.tests.dotty(tests.scala:139)

@odersky can you have a look?

odersky added 3 commits May 7, 2015 11:33
…y compiled.

It seems wasteful to load the member classes even of classes that are not currently compiled.
It also makes us vulnerable to any misinterpretation of Java file formats. In th particular
case of scala#536, we parsed a class an anonymous Collection$1 which was referring to the type
parameter of its enclosing class, but was not diagnosed as an inner class of the enclosing class.
…ate.

Symbols never change betwene terms and types. So we do not need to the current
denotation to decide what they are. Less forcing -> less potential for cyclic
references.
@odersky
Copy link
Contributor

odersky commented May 7, 2015

What was the actual assertion violation?

I can't reproduce this. It's really weird. When I first pulled the branch and do sbt test I did get findMember exceptions which were NotDefinedHere violations. I made them go away by adding FutureDefsOK to the rootContext. But now I cannot even get there. I get lots of errors like this:

./src/dotty/tools/backend/jvm/CollectEntryPoints.scala:72: error: type mismatch:
found : sym.ThisName
required: ?{ +: ? }
ctx.warning( sym.name +
^
./src/dotty/tools/backend/jvm/CollectEntryPoints.scala:116: error: missing parameter type for parameter $1, expected = ?
if (t.resultType :: paramTypes exists (
.typeSymbol.isAbstractType))
^
./src/dotty/tools/backend/jvm/CollectEntryPoints.scala:116: error: type mismatch:
found : dotty.tools.dotc.core.Symbols.Symbol
required: ?{ isAbstractType: ? }
if (t.resultType :: paramTypes exists (_.typeSymbol.isAbstractType))
^
./src/dotty/tools/backend/jvm/CollectEntryPoints.scala:111: error: missing parameter type for parameter m, expected = ?
possibles exists { m =>
^
./src/dotty/tools/backend/jvm/DottyBackendInterface.scala:149: error: type mismatch:
found : dotty.tools.dotc.core.Symbols.Symbol
required: ?{ requiredValue: ? }
lazy val AnnotationRetentionSourceAttr = ctx.requiredClass("java.lang.annotation.RetentionPolicy").linkedClass.requiredValue("SOURCE")

followed by a assertion failure in withType. I get the same errors with eclipse. Something seems to be wrong with the classpaths here.

@DarkDimius
Copy link
Contributor Author

The errors that you have I haven't seen. Though travis failed with a different error.

The actual violation is

[error] Test dotc.tests.dotty failed: dotty.tools.dotc.core.Denotations$NotDefinedHere: demanding denotation of <SingleDenotation of type ClassInfo(ThisType(TypeRef(ThisType(TypeRef(NoPrefix,settings)),ScalaSettings)), class BooleanSetting)> at phase frontend(1) outside defined interval: defined periods are Period(14..18, run = 2), took 26.306 sec

And It I can reproduce it locally on a clean clone of the repo.
Adding adding FutureDefsOK would definitely silence it, but the assertion seems strange, as the denotation seems to be not defined during typer.

@DarkDimius
Copy link
Contributor Author

Travis reproduced the error.

@odersky
Copy link
Contributor

odersky commented May 7, 2015

I figured out what the previous errors are. Now we get much further, and die in BackendInterface#memberClasses.

@odersky
Copy link
Contributor

odersky commented May 7, 2015

@DarkDimius I suggest you merge with #544. memberClasses is causing this error, and the way it is defined here it is definitely broken.

@DarkDimius
Copy link
Contributor Author

I believe that bb9eb23 silences actual error: we have a denotation for BooleanSetting, that is needed during erasure but which is not defined during typer. But this denotation should have been forced by the typer, but instead it was forced by a later phase.

@odersky
Copy link
Contributor

odersky commented May 7, 2015

Indeed the error was the NotDefinedHere, and the other symptom was a follow-on. I have pushed a commit that undoes the previous two commits and solves the NotDefinedHere problem. We are now
still at the problem with memberClasses, but maybe a merge with #544 will fix that.

DarkDimius and others added 13 commits May 8, 2015 13:32
We used to require that the result type of an extractor `get` is a product,
or else the type of the `get` itself would be taken as the result type of the
unapply. This is now relaxed so that we automatically select with _1, _2, ...
as soon as there are multiple argument patterns, and (1) the result type is not
a Seq, (2) the number of consecutive product conselectors matches the number
of arguments.
…s path and in compiled source.

[error] Test dotc.tests.dotty failed: java.lang.AssertionError: assertion failed: data race? overwriting symbol of dotty.DottyPredef$ / TypeRef(ThisType(TypeRef(NoPrefix,dotty)),DottyPredef$) / class dotty.tools.dotc.core.Types$CachedTypeRef / 9007 / 9748, took 1.276 sec
[error]     at scala.Predef$.assert(Predef.scala:165)
[error]     at dotty.tools.dotc.core.Types$NamedType.checkSymAssign(Types.scala:1263)
[error]     at dotty.tools.dotc.core.Types$NamedType.setDenot(Types.scala:1293)
[error]     at dotty.tools.dotc.core.Types$NamedType.withDenot(Types.scala:1286)
[error]     at dotty.tools.dotc.core.Types$TypeRef$.apply(Types.scala:1669)
[error]     at dotty.tools.dotc.core.Types$Type.select(Types.scala:819)
[error]     at dotty.tools.dotc.typer.Namer.moduleValSig(Namer.scala:602)
[error]     at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:465)
[error]     at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:499)
[error]     at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:495)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:161)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:143)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:253)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.flags(SymDenotations.scala:97)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.is(SymDenotations.scala:119)
[error]     at dotty.tools.dotc.core.SymDenotations$SymDenotation.isStable(SymDenotations.scala:464)
[error]     at dotty.tools.dotc.core.Types$Type.widenIfUnstable(Types.scala:691)
[error]     at dotty.tools.dotc.core.Types$Type$$anonfun$member$1.apply(Types.scala:394)
[error]     at dotty.tools.dotc.core.Types$Type$$anonfun$member$1.apply(Types.scala:394)
[error]     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
[error]     at dotty.tools.dotc.core.Types$Type.member(Types.scala:393)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedIdent$1.wildImportRef$1(Typer.scala:192)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedIdent$1.findRef$1(Typer.scala:240)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedIdent$1.apply(Typer.scala:263)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedIdent$1.apply(Typer.scala:79)
[error]     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
[error]     at dotty.tools.dotc.typer.Typer.typedIdent(Typer.scala:79)
[error]     at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1017)
[error]     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1076)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1088)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1086)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:147)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1086)
[error]     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1125)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:961)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:960)
[error]     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
[error]     at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:960)
[error]     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1066)
[error]     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1078)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1088)
[error]     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1086)
[error]     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:147)
[error]     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:51)
[error]     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1086)
[error]     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1125)
[error]     at dotty.tools.dotc.typer.FrontEnd$$anonfun$typeCheck$1.apply$mcV$sp(FrontEnd.scala:41)
[error]     at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:18)
[error]     at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:39)
[error]     at dotty.tools.dotc.typer.FrontEnd$$anonfun$runOn$3.apply(FrontEnd.scala:52)
[error]     at dotty.tools.dotc.typer.FrontEnd$$anonfun$runOn$3.apply(FrontEnd.scala:52)
[error]     at scala.collection.immutable.List.foreach(List.scala:381)
[error]     at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:52)
[error]     at dotty.tools.dotc.Run$$anonfun$compileSources$1$$anonfun$apply$mcV$sp$3.apply(Run.scala:55)
[error]     at dotty.tools.dotc.Run$$anonfun$compileSources$1$$anonfun$apply$mcV$sp$3.apply(Run.scala:52)
[error]     at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
[error]     at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
[error]     at dotty.tools.dotc.Run$$anonfun$compileSources$1.apply$mcV$sp(Run.scala:52)
[error]     at dotty.tools.dotc.Run$$anonfun$compileSources$1.apply(Run.scala:47)
[error]     at dotty.tools.dotc.Run$$anonfun$compileSources$1.apply(Run.scala:47)
[error]     at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:68)
[error]     at dotty.tools.dotc.Run.compileSources(Run.scala:46)
[error]     at dotty.tools.dotc.Run.compile(Run.scala:33)
[error]     at dotty.tools.dotc.Driver.doCompile(Driver.scala:20)
[error]     at dotty.tools.dotc.Bench$.dotty$tools$dotc$Bench$$super$doCompile(Bench.scala:38)
[error]     at dotty.tools.dotc.Bench$$anonfun$doCompile$1.apply(Bench.scala:38)
[error]     at dotty.tools.dotc.Bench$$anonfun$doCompile$1.apply(Bench.scala:36)
[error]     at dotty.tools.dotc.Bench$$anonfun$ntimes$1.apply(Bench.scala:30)
[error]     at dotty.tools.dotc.Bench$$anonfun$ntimes$1.apply(Bench.scala:30)
[error]     at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:142)
[error]     at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:142)
[error]     at scala.collection.immutable.Range.foreach(Range.scala:166)
[error]     at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:142)
[error]     at scala.collection.AbstractTraversable.foldLeft(Traversable.scala:104)
[error]     at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:136)
[error]     at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:104)
[error]     at dotty.tools.dotc.Bench$.ntimes(Bench.scala:30)
[error]     at dotty.tools.dotc.Bench$.doCompile(Bench.scala:36)
[error]     at dotty.tools.dotc.Driver.process(Driver.scala:31)
[error]     at dotty.tools.dotc.Bench$.dotty$tools$dotc$Bench$$super$process(Bench.scala:53)
[error]     at dotty.tools.dotc.Bench$$anonfun$process$1.apply(Bench.scala:53)
[error]     at dotty.tools.dotc.Bench$$anonfun$process$1.apply(Bench.scala:53)
[error]     at dotty.tools.dotc.Bench$$anonfun$ntimes$1.apply(Bench.scala:30)
[error]     at dotty.tools.dotc.Bench$$anonfun$ntimes$1.apply(Bench.scala:30)
[error]     at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:142)
[error]     at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:142)
[error]     at scala.collection.immutable.Range.foreach(Range.scala:166)
[error]     at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:142)
[error]     at scala.collection.AbstractTraversable.foldLeft(Traversable.scala:104)
[error]     at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:136)
[error]     at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:104)
[error]     at dotty.tools.dotc.Bench$.ntimes(Bench.scala:30)
[error]     at dotty.tools.dotc.Bench$.process(Bench.scala:53)
[error]     at test.CompilerTest.compileArgs(CompilerTest.scala:159)
[error]     at test.CompilerTest.compileDir(CompilerTest.scala:104)
[error]     at dotc.tests.dotty(tests.scala:141)
Implicit vals need explicit type, anonymous classes are widened.
Includes fixes to lambas, and no type projections in signatures.
Up to now a NotDefinedHere exception was thrown if a denotation
was not defined at the current phase, but was defined elsewhere
in the current run. However, if the denotation is a SingleDenotation
or MultiDenotation it is possible that the particular Single- or Multi-Denotation
was not computed at the current phase, but the underlying SymDenotation
is valid. With the changes in this commit, we reaload the denotation as
a second try.
@DarkDimius
Copy link
Contributor Author

@odersky please review 10610cb

def nestedClasses: List[Symbol] = memberClasses //exitingPhase(currentRun.lambdaliftPhase)(sym.memberClasses)
def memberClasses: List[Symbol] = toDenot(sym).info.memberClasses.map(_.symbol).toList

/** For currently compiled classes: All locally defined classes including local classes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between a "locally defined class" and a "local class"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is:

class A{
  class B
  def foo = {
    class C
  }
}

Class B is locally defined, class C is local.
Though the naming here is indeed confusing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, "local classes" is Java lingo.

On Fri, May 8, 2015 at 4:43 PM, Dmitry Petrashko [email protected]
wrote:

In src/dotty/tools/backend/jvm/DottyBackendInterface.scala
#543 (comment):

@@ -678,8 +686,24 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{

 // members
 def primaryConstructor: Symbol = toDenot(sym).primaryConstructor
  • def nestedClasses: List[Symbol] = memberClasses //exitingPhase(currentRun.lambdaliftPhase)(sym.memberClasses)
  • def memberClasses: List[Symbol] = toDenot(sym).info.memberClasses.map(_.symbol).toList
  • /** For currently compiled classes: All locally defined classes including local classes.

My guess is:

class A{
class B
def foo = {
class C
}
}

Class B is locally defined, class C is local.
Though the naming here is indeed confusing.


Reply to this email directly or view it on GitHub
https://github.com/lampepfl/dotty/pull/543/files#r29944973.

Martin Odersky
EPFL

@odersky
Copy link
Contributor

odersky commented May 9, 2015

I think we can merge this now to make progress. I'll get back to the dotty deviation once this is in.

odersky added a commit that referenced this pull request May 9, 2015
@odersky odersky merged commit 8838aef into scala:master May 9, 2015
@allanrenucci allanrenucci deleted the compile-dotty branch December 14, 2017 16:58
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

Successfully merging this pull request may close these issues.

3 participants