Skip to content

Whitelisting scala.util.Sorting crashes the compiler. #1824

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
nicolasstucki opened this issue Dec 18, 2016 · 0 comments
Closed

Whitelisting scala.util.Sorting crashes the compiler. #1824

nicolasstucki opened this issue Dec 18, 2016 · 0 comments
Assignees

Comments

@nicolasstucki
Copy link
Contributor

Whitelisting scala/util/Sorting.scala crashes in partest with:

 assertion failed: invalid prefix ImplicitMethodType(List(ord), List(RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,math)),Ordering), scala$math$Ordering$$T, TypeAlias(TypeRef(NoPrefix,K), 0))), RefinedType(TypeRef(ThisType(TypeRef(NoPrefix,math)),Ordering), scala$math$Ordering$$T, TypeAlias(TypeRef(NoPrefix,K), 0)))
     at scala.Predef$.assert(Predef.scala:165)
     at dotty.tools.dotc.core.Types$NamedType.<init>(Types.scala:1378)
     at dotty.tools.dotc.core.Types$TermRef.<init>(Types.scala:1727)
     at dotty.tools.dotc.core.Types$TermRefWithSignature.<init>(Types.scala:1763)
     at dotty.tools.dotc.core.Types$TermRef$.withSig(Types.scala:1919)
     at dotty.tools.dotc.core.Types$TermRefWithSignature.newLikeThis(Types.scala:1773)
     at dotty.tools.dotc.core.Types$TermRefWithSignature.newLikeThis(Types.scala:1763)
     at dotty.tools.dotc.core.Types$NamedType.derivedSelect(Types.scala:1674)
     at dotty.tools.dotc.ast.tpd$TypedTreeCopier.Select(tpd.scala:468)
     at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1078)
     at dotty.tools.dotc.ast.TreeTypeMap.transform(TreeTypeMap.scala:116)
     at dotty.tools.dotc.ast.TreeTypeMap.apply(TreeTypeMap.scala:137)
     at dotty.tools.dotc.ast.tpd$TreeOps$.loop$1(tpd.scala:613)
     at dotty.tools.dotc.ast.tpd$TreeOps$.changeOwner$extension(tpd.scala:616)
     at dotty.tools.dotc.typer.Typer.typedTypedSplice(Typer.scala:1416)
     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1521)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1535)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1607)
     at dotty.tools.dotc.typer.Applications$$anonfun$realApply$1$1.apply(Applications.scala:610)
     at dotty.tools.dotc.typer.Applications$$anonfun$realApply$1$1.apply(Applications.scala:608)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Applications$class.realApply$1(Applications.scala:608)
     at dotty.tools.dotc.typer.Applications$class.typedApply(Applications.scala:705)
     at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:64)
     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1489)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1535)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1607)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedDefDef$1.apply(Typer.scala:1205)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedDefDef$1.apply(Typer.scala:1188)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:1188)
     at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1477)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1534)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1575)
     at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1595)
     at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:596)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedBlock$1.apply(Typer.scala:599)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedBlock$1.apply(Typer.scala:598)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:598)
     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1496)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1535)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedFunction$1.apply(Typer.scala:785)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedFunction$1.apply(Typer.scala:664)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Typer.typedFunction(Typer.scala:664)
     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1498)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1535)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:1890)
     at dotty.tools.dotc.typer.Typer.adaptInterpolated(Typer.scala:2042)
     at dotty.tools.dotc.typer.Typer$$anonfun$adapt$1$$anonfun$apply$35.apply(Typer.scala:1690)
     at dotty.tools.dotc.typer.Typer$$anonfun$adapt$1$$anonfun$apply$35.apply(Typer.scala:1686)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer$$anonfun$adapt$1.apply(Typer.scala:1686)
     at dotty.tools.dotc.typer.Typer$$anonfun$adapt$1.apply(Typer.scala:1686)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:1685)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.typedAsFunction(Typer.scala:1424)
     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1523)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1535)
     at dotty.tools.dotc.typer.ProtoTypes$FunProto$$anonfun$1.apply(ProtoTypes.scala:235)
     at dotty.tools.dotc.typer.ProtoTypes$FunProto$$anonfun$1.apply(ProtoTypes.scala:235)
     at dotty.tools.dotc.typer.ProtoTypes$FunProto.dotty$tools$dotc$typer$ProtoTypes$FunProto$$cacheTypedArg(ProtoTypes.scala:213)
     at dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:235)
     at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:585)
     at dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:583)
     at dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:385)
     at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:424)
     at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:425)
     at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:425)
     at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:425)
     at dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:425)
     at dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:227)
     at dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:503)
     at dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:584)
     at dotty.tools.dotc.typer.Applications$$anonfun$realApply$1$1.dotty$tools$dotc$typer$Applications$class$$anonfun$$simpleApply$1(Applications.scala:638)
     at dotty.tools.dotc.typer.Applications$$anonfun$realApply$1$1$$anonfun$apply$5.apply(Applications.scala:661)
     at dotty.tools.dotc.typer.Applications$$anonfun$realApply$1$1$$anonfun$apply$5.apply(Applications.scala:661)
     at dotty.tools.dotc.typer.Typer.tryEither(Typer.scala:1615)
     at dotty.tools.dotc.typer.Applications$$anonfun$realApply$1$1.apply(Applications.scala:662)
     at dotty.tools.dotc.typer.Applications$$anonfun$realApply$1$1.apply(Applications.scala:608)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Applications$class.realApply$1(Applications.scala:608)
     at dotty.tools.dotc.typer.Applications$class.typedApply(Applications.scala:705)
     at dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:64)
     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1489)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1535)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1607)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedBlock$1.apply(Typer.scala:606)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedBlock$1.apply(Typer.scala:598)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:598)
     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1496)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1535)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1607)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedDefDef$1.apply(Typer.scala:1205)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedDefDef$1.apply(Typer.scala:1188)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:1188)
     at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1477)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1534)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1575)
     at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1595)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedClassDef$1.apply(Typer.scala:1287)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedClassDef$1.apply(Typer.scala:1235)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1235)
     at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1480)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1534)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1575)
     at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1595)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:1395)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:1382)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1382)
     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1519)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1535)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:1586)
     at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:1595)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:1395)
     at dotty.tools.dotc.typer.Typer$$anonfun$typedPackageDef$1.apply(Typer.scala:1382)
     at dotty.tools.dotc.util.Stats$.track(Stats.scala:35)
     at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1382)
     at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1519)
     at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1535)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1553)
     at dotty.tools.dotc.typer.Typer$$anonfun$typed$2.apply(Typer.scala:1551)
     at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:136)
     at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:57)
     at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1551)
     at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1607)
     at dotty.tools.dotc.typer.FrontEnd$$anonfun$typeCheck$1.apply$mcV$sp(FrontEnd.scala:55)
     at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:23)
     at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:53)
     at dotty.tools.dotc.typer.FrontEnd$$anonfun$runOn$4.apply(FrontEnd.scala:80)
     at dotty.tools.dotc.typer.FrontEnd$$anonfun$runOn$4.apply(FrontEnd.scala:80)
     at scala.collection.immutable.List.foreach(List.scala:381)
     at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:80)
     at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:75)
     at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:72)
     at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
     at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
     at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply$mcV$sp(Run.scala:72)
     at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:66)
     at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:66)
     at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:76)
     at dotty.tools.dotc.Run.compileUnits(Run.scala:66)
     at dotty.tools.dotc.Run.compileSources(Run.scala:63)
     at dotty.tools.dotc.Run.compile(Run.scala:47)
     at dotty.tools.dotc.Driver.doCompile(Driver.scala:26)
     at dotty.tools.dotc.Driver.process(Driver.scala:124)
     at dotty.tools.dotc.Driver.process(Driver.scala:93)
     at dotty.tools.dotc.CompilerTest.compileArgs(CompilerTest.scala:282)
     at dotty.tools.dotc.CompilerTest.compileList(CompilerTest.scala:227)
     at dotc.tests.compileStdLib(tests.scala:245)
odersky added a commit to dotty-staging/dotty that referenced this issue Dec 18, 2016
An operation was performed quadratically before.
@odersky odersky self-assigned this Dec 18, 2016
odersky added a commit to dotty-staging/dotty that referenced this issue Dec 18, 2016
An operation was performed quadratically before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants