Skip to content

Stale symbol error in REPL #1374

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
DarkDimius opened this issue Jul 8, 2016 · 0 comments
Closed

Stale symbol error in REPL #1374

DarkDimius opened this issue Jul 8, 2016 · 0 comments

Comments

@DarkDimius
Copy link
Contributor

http://scalapuzzlers.com/#pzzlr-027

implicit class Padder(val sb: StringBuilder) extends AnyVal {
  def pad2(width: Int) = {
    1 to width - sb.length foreach { sb append '*' }
    sb
  }
}

// greeting.length == 14
val greeting = new StringBuilder("Hello, kitteh!")
println(greeting pad2 20)

// farewell.length == 9
val farewell = new StringBuilder("U go now.")  // I hatez long bye-bye.
println(farewell pad2 20)
xception in thread "main" dotty.tools.dotc.core.Denotations$StaleSymbol: stale symbol; method pad2$extension#33413 in module class Padder$, defined in Period(12..31, run = 4), is referred to in run Period(13..13, run = 12)
    at dotty.tools.dotc.core.Denotations$SingleDenotation.staleSymbolError(Denotations.scala:800)
    at dotty.tools.dotc.core.Denotations$SingleDenotation.bringForward(Denotations.scala:616)
    at dotty.tools.dotc.core.Denotations$SingleDenotation.currentIfExists(Denotations.scala:645)
    at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:715)
    at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:387)
    at dotty.tools.dotc.core.Scopes$Scope.denotsNamed(Scopes.scala:119)
    at dotty.tools.dotc.core.Types$Type.findDecl(Types.scala:377)
    at dotty.tools.dotc.core.Types$Type$$anonfun$decl$1.apply(Types.scala:363)
    at dotty.tools.dotc.core.Types$Type$$anonfun$decl$1.apply(Types.scala:363)
    at dotty.tools.dotc.util.Stats$.track(Stats.scala:36)
    at dotty.tools.dotc.core.Types$Type.decl(Types.scala:362)
    at dotty.tools.dotc.transform.ExtensionMethods$$anonfun$extensionMethod$1$$anonfun$3.apply(ExtensionMethods.scala:215)
    at dotty.tools.dotc.transform.ExtensionMethods$$anonfun$extensionMethod$1$$anonfun$3.apply(ExtensionMethods.scala:215)
    at scala.collection.immutable.Stream.map(Stream.scala:418)
    at dotty.tools.dotc.transform.ExtensionMethods$$anonfun$extensionMethod$1.apply(ExtensionMethods.scala:215)
    at dotty.tools.dotc.transform.ExtensionMethods$$anonfun$extensionMethod$1.apply(ExtensionMethods.scala:212)
    at dotty.tools.dotc.core.Periods.atPhase(Periods.scala:26)
    at dotty.tools.dotc.core.Phases$class.atPhase(Phases.scala:33)
    at dotty.tools.dotc.core.Contexts$Context.atPhase(Contexts.scala:55)
    at dotty.tools.dotc.transform.ExtensionMethods$.extensionMethod(ExtensionMethods.scala:212)
    at dotty.tools.dotc.transform.VCInlineMethods.rewire(VCInlineMethods.scala:67)
    at dotty.tools.dotc.transform.VCInlineMethods.rewireIfNeeded(VCInlineMethods.scala:93)
    at dotty.tools.dotc.transform.VCInlineMethods.transformApply(VCInlineMethods.scala:103)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.goApply(TreeTransform.scala:611)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformUnnamed(TreeTransform.scala:1034)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1211)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transformTrees$1.apply(TreeTransform.scala:1245)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transformTrees$1.apply(TreeTransform.scala:1245)
    at scala.collection.immutable.List.loop$1(List.scala:173)
    at scala.collection.immutable.List.mapConserve(List.scala:189)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformTrees(TreeTransform.scala:1245)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformSubTrees(TreeTransform.scala:1251)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformUnnamed(TreeTransform.scala:1033)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1211)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformNamed(TreeTransform.scala:990)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1210)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.dotty$tools$dotc$transform$TreeTransforms$TreeTransformer$$transformStat$1(TreeTransform.scala:1236)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$38.apply(TreeTransform.scala:1240)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$38.apply(TreeTransform.scala:1240)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:50)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:66)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformStats(TreeTransform.scala:1240)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformUnnamed(TreeTransform.scala:1181)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1211)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformNamed(TreeTransform.scala:1008)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1210)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.dotty$tools$dotc$transform$TreeTransforms$TreeTransformer$$transformStat$1(TreeTransform.scala:1236)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$38.apply(TreeTransform.scala:1240)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$38.apply(TreeTransform.scala:1240)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:50)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:66)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformStats(TreeTransform.scala:1240)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformUnnamed(TreeTransform.scala:1181)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1211)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformNamed(TreeTransform.scala:1008)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1210)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.dotty$tools$dotc$transform$TreeTransforms$TreeTransformer$$transformStat$1(TreeTransform.scala:1236)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$38.apply(TreeTransform.scala:1240)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$38.apply(TreeTransform.scala:1240)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:50)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:66)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformStats(TreeTransform.scala:1240)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformUnnamed(TreeTransform.scala:1181)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1211)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformNamed(TreeTransform.scala:1008)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1210)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.dotty$tools$dotc$transform$TreeTransforms$TreeTransformer$$transformStat$1(TreeTransform.scala:1236)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$38.apply(TreeTransform.scala:1240)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$38.apply(TreeTransform.scala:1240)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:50)
    at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:66)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformStats(TreeTransform.scala:1240)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transformUnnamed(TreeTransform.scala:1190)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1211)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer$$anonfun$transform$2.apply(TreeTransform.scala:1203)
    at dotty.tools.dotc.reporting.Reporting$class.traceIndented(Reporter.scala:131)
    at dotty.tools.dotc.core.Contexts$Context.traceIndented(Contexts.scala:55)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.transform(TreeTransform.scala:1202)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.macroTransform(TreeTransform.scala:560)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.run(TreeTransform.scala:477)
    at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:278)
    at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:276)
    at scala.collection.immutable.List.map(List.scala:273)
    at dotty.tools.dotc.core.Phases$Phase$class.runOn(Phases.scala:276)
    at dotty.tools.dotc.transform.TreeTransforms$TreeTransformer.runOn(TreeTransform.scala:471)
    at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:62)
    at dotty.tools.dotc.Run$$anonfun$compileUnits$1$$anonfun$apply$mcV$sp$1.apply(Run.scala:59)
    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:59)
    at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:54)
    at dotty.tools.dotc.Run$$anonfun$compileUnits$1.apply(Run.scala:54)
    at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:69)
    at dotty.tools.dotc.Run.compileUnits(Run.scala:54)
    at dotty.tools.dotc.Run.compileSources(Run.scala:51)
    at dotty.tools.dotc.repl.CompilingInterpreter.compileSources(CompilingInterpreter.scala:195)
    at dotty.tools.dotc.repl.CompilingInterpreter$Request.compile(CompilingInterpreter.scala:397)
    at dotty.tools.dotc.repl.CompilingInterpreter.interpret(CompilingInterpreter.scala:218)
    at dotty.tools.dotc.repl.CompilingInterpreter.interpret(CompilingInterpreter.scala:215)
    at dotty.tools.dotc.repl.AmmoniteReader$$anonfun$2.apply(AmmoniteReader.scala:19)
    at dotty.tools.dotc.repl.AmmoniteReader$$anonfun$2.apply(AmmoniteReader.scala:19)
    at dotty.tools.dotc.repl.CompilingInterpreter.delayOutputDuring(CompilingInterpreter.scala:103)
    at dotty.tools.dotc.repl.AmmoniteReader.incompleteInput(AmmoniteReader.scala:19)
    at dotty.tools.dotc.repl.AmmoniteReader$$anonfun$1.applyOrElse(AmmoniteReader.scala:31)
    at dotty.tools.dotc.repl.AmmoniteReader$$anonfun$1.applyOrElse(AmmoniteReader.scala:29)
    at scala.PartialFunction$Lifted.apply(PartialFunction.scala:223)
    at scala.PartialFunction$Lifted.apply(PartialFunction.scala:219)
    at dotty.tools.dotc.repl.ammonite.terminal.Filter$$anon$1$$anonfun$1$$anonfun$apply$1.apply(Filter.scala:21)
    at dotty.tools.dotc.repl.ammonite.terminal.Filter$$anon$1$$anonfun$1$$anonfun$apply$1.apply(Filter.scala:21)
    at scala.collection.Iterator$$anon$11.next(Iterator.scala:370)
    at scala.collection.Iterator$class.find(Iterator.scala:802)
    at scala.collection.AbstractIterator.find(Iterator.scala:1202)
    at dotty.tools.dotc.repl.ammonite.terminal.Filter$$anon$1$$anonfun$1.apply(Filter.scala:21)
    at dotty.tools.dotc.repl.ammonite.terminal.Filter$$anon$1$$anonfun$1.apply(Filter.scala:21)
    at dotty.tools.dotc.repl.ammonite.terminal.Terminal$.readChar$1(Terminal.scala:267)
    at dotty.tools.dotc.repl.ammonite.terminal.Terminal$.readLine(Terminal.scala:299)
    at dotty.tools.dotc.repl.AmmoniteReader.readLine(AmmoniteReader.scala:54)
    at dotty.tools.dotc.repl.InterpreterLoop.repl$default$1(InterpreterLoop.scala:74)
    at dotty.tools.dotc.repl.InterpreterLoop.repl(InterpreterLoop.scala:80)
    at dotty.tools.dotc.repl.InterpreterLoop.run(InterpreterLoop.scala:210)
    at dotty.tools.dotc.repl.REPL.doCompile(REPL.scala:43)
    at dotty.tools.dotc.Driver.process(Driver.scala:124)
    at dotty.tools.dotc.Driver.process(Driver.scala:93)
    at dotty.tools.dotc.Driver.process(Driver.scala:105)
    at dotty.tools.dotc.Driver.main(Driver.scala:132)
    at dotty.tools.dotc.repl.Main.main(Main.scala)
OlivierBlanvillain pushed a commit to OlivierBlanvillain/dotty that referenced this issue Dec 8, 2016
OlivierBlanvillain pushed a commit to OlivierBlanvillain/dotty that referenced this issue Dec 12, 2016
odersky added a commit that referenced this issue Dec 29, 2017
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

2 participants