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

RangePos crashes for generic dynamics #10203

Closed
scabug opened this issue Feb 23, 2017 · 1 comment · Fixed by scala/scala#6423
Closed

RangePos crashes for generic dynamics #10203

scabug opened this issue Feb 23, 2017 · 1 comment · Fixed by scala/scala#6423
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Feb 23, 2017

I found that I couldn't run scoverage on a project due to compiler crashes. I reduced the issue to the following:

$ scala -Yrangepos
Welcome to Scala 2.12.1 (OpenJDK 64-Bit Server VM, Java 1.8.0_66).
Type in expressions for evaluation. Or try :help.

scala> import language.dynamics
import language.dynamics

scala> object O extends Dynamic {
     |   def selectDynamic[T](nme: String): String = nme
     | }
defined object O

scala> O.aaaaaaaaaaaaa[Int]
======= Position error
Enclosing tree [6335] does not include tree [6334]
== Enclosing tree [6335] of type Apply at [145:146]<console>

[L  14        ] #6335   [145:146]       Apply      // O.

== Enclosed tree [6334] of type TypeApply at [145:164]<console>

[L  14        ] #6334   [145:164]       TypeApply  // O.aaaaaaaaaaaaa[Int]


While validating #6354
[L   1        ] #6354   [0:174]         PackageDef // $line8

Children:
  [L   1 P# 6354] #6178   [8:14]          Ident      // $line8
  [L   5 P# 6354] #6353   [18:174]        ModuleDef  // $read {
=======
scala.reflect.internal.Positions$ValidateException: Enclosing tree [6335] does not include tree [6334]
	at scala.reflect.internal.Positions.validate$1(Positions.scala:102)
	at scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:142)
	at scala.reflect.internal.Positions.validate$1(Positions.scala:142)
	at scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:142)
	at scala.reflect.internal.Positions.validate$1(Positions.scala:142)
	at scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:142)
	at scala.reflect.internal.Positions.validate$1(Positions.scala:142)
	at scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:142)
	at scala.reflect.internal.Positions.validate$1(Positions.scala:142)
	at scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:142)
	at scala.reflect.internal.Positions.validate$1(Positions.scala:142)
	at scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:142)
	at scala.reflect.internal.Positions.validate$1(Positions.scala:142)
	at scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:142)
	at scala.reflect.internal.Positions.validate$1(Positions.scala:142)
	at scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:142)
	at scala.reflect.internal.Positions.validate$1(Positions.scala:142)
	at scala.reflect.internal.Positions.$anonfun$validatePositions$12(Positions.scala:142)
	at scala.reflect.internal.Positions.validate$1(Positions.scala:142)
	at scala.reflect.internal.Positions.validatePositions(Positions.scala:147)
	at scala.reflect.internal.Positions.validatePositions$(Positions.scala:83)
	at scala.reflect.internal.SymbolTable.validatePositions(SymbolTable.scala:16)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:103)
	at scala.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:416)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:409)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1(Analyzer.scala:94)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1$adapted(Analyzer.scala:93)
	at scala.collection.Iterator.foreach(Iterator.scala:929)
	at scala.collection.Iterator.foreach$(Iterator.scala:929)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1406)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1418)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1403)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1398)
	at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:430)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:801)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:759)
	at scala.tools.nsc.interpreter.IMain$Request.compile$lzycompute(IMain.scala:948)
	at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:943)
	at scala.tools.nsc.interpreter.IMain.compile(IMain.scala:599)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:588)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:560)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:825)
	at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:684)
	at scala.tools.nsc.interpreter.ILoop.processLine(ILoop.scala:402)
	at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:423)
	at scala.tools.nsc.interpreter.ILoop.$anonfun$process$1(ILoop.scala:993)
	at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:892)
	at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:75)
	at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:88)
	at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:99)
	at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:104)
	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

That entry seems to have slain the compiler.  Shall I replay
your session? I can re-run each line except the last one.
[y/n]
Abandoning crashed session.
@scabug
Copy link
Author

scabug commented Feb 23, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10203?orig=1
Reporter: @clhodapp
Affected Versions: 2.12.1

@scabug scabug added this to the Backlog milestone Apr 7, 2017
@hrhino hrhino self-assigned this Mar 14, 2018
hrhino added a commit to hrhino/scala that referenced this issue Mar 19, 2018
The result is more accurate positions for some dynamics,
as can be seen in the diffs for `run/dynamic-*.scala`,
and less crashy positions for others, as can be seen in
the attached new test case.

Fixes scala/bug#10203.
@hrhino hrhino modified the milestones: Backlog, 2.13.0-M4 Mar 19, 2018
hrhino added a commit to hrhino/scala that referenced this issue Mar 19, 2018
The result is more accurate positions for some dynamics,
as can be seen in the diffs for `run/dynamic-*.scala`,
and less crashy positions for others, as can be seen in
the attached new test case.

Fixes scala/bug#10203.
hrhino added a commit to hrhino/scala that referenced this issue Mar 21, 2018
The result is more accurate positions for some dynamics,
as can be seen in the diffs for `run/dynamic-*.scala`,
and less crashy positions for others, as can be seen in
the attached new test case.

Fixes scala/bug#10203.
@lrytz lrytz added the has PR label Apr 19, 2018
@SethTisue SethTisue modified the milestones: 2.13.0-M4, 2.13.0-M5 May 9, 2018
hrhino added a commit to hrhino/scala that referenced this issue May 14, 2018
The result is more accurate positions for some dynamics,
as can be seen in the diffs for `run/dynamic-*.scala`,
and less crashy positions for others, as can be seen in
the attached new test case.

Fixes scala/bug#10203.
hrhino added a commit to hrhino/scala that referenced this issue May 14, 2018
The result is more accurate positions for some dynamics,
as can be seen in the diffs for `run/dynamic-*.scala`,
and less crashy positions for others, as can be seen in
the attached new test case.

Fixes scala/bug#10203.
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.

4 participants